사업왕이 커가는곳

오라클에서 엄청난 양의 메뉴얼을 제공해 준다...
하지만 너무 자세하다는 사실에 오히려 두려움을 느낀다...
내가 지금까지 해 오던 방식을 찾아 해매야겠지. ㅜㅜ

일단은 디비에 접속만 먼저 해야겠다...

여기 까지는 비슷한데.. 파라메타 붙여서 쿼리 할려다 실패하고...
주문했다... 내일 온다니.. 기다려 본다. 여러권 골랐었는데...
진우형이 이걸로 하라고 하네.. 귀찮아서 그냥 표지가 예쁜거 고른 느낌이지만... 

    Public Function ConnectionString() As String
        Try
            ConnectionString = _
                        "Provider=OraOLEDB.Oracle.1" & _
                        "; User ID=?????? "
                        "; Password=?????? "
                        "; Data Source=127.0.0.1:1521 "    ' 포트 확인하시고요.
        Catch ex As Exception
            Return ""
        End Try
    End Function

어딘가에 접속문장을 만들어줄 요놈을 선언하고...

사용법은... 
예를 들어 콤보 박스를 채워주는 함수를 하나 복사한다.

   Public Sub fnSetAutoCombo(ByVal strQuery As String, ByVal TargetCombo As ComboBox, ByVal AllText As String)
        Dim strConn As New OleDbConnection(ConnectionString)           ' 컨넥션 생성하고
        Dim cmdSQL As OleDbCommand = strConn.CreateCommand()   ' 그 컨넥션을 이용해서 커멘드를 만든다.
        Dim dr As OleDbDataReader    ' 자료를 받아와서 읽을 리더를 선언한다.

        Try
            cmdSQL.CommandType = CommandType.Text
            cmdSQL.CommandText = strQuery

            With cmdSQL.Parameters
                .Clear()
            End With
            
            strConn.Open()    ' 디비 오픈하고.. 혹시 오픈이 안되면 서버의 상태를 확인해 봐야겠지.. 방화벽은 열어주셨나요? ㅋㅋ
            dr = cmdSQL.ExecuteReader ' 리더로 날린 쿼리의 정보를 받아 오면 됩니다.

            TargetCombo.BeginUpdate()
            TargetCombo.Items.Clear()

            If AllText.Length > 0 Then
                TargetCombo.Items.Add(AllText)
            End If

            If dr.HasRows Then
                While dr.Read   ' 읽어서 쓰시길
                    TargetCombo.Items.Add(dr(0))
                End While
            End If

            TargetCombo.EndUpdate()
            dr.Close()
        Catch ex As Exception
            fnErrorReport("MdCommonFunction::fnSetAutoCombo", ex)
        Finally
            strConn.Close()   ' 당근 다쓰면 돌려줘야겠지...
        End Try

        If TargetCombo.Items.Count > 0 Then
            TargetCombo.SelectedIndex = 0
        End If

        If TargetCombo.Items.Count = 0 Then
            TargetCombo.Enabled = False
        Else
            TargetCombo.Enabled = True
        End If
    End Sub

너무 하던 방식대로.. MSsql에서 되니까.. 여기도 똑같이 될꺼야 하는 식으로 접근하면 작업이 어려울것 같다.. ㅜㅜ
어쩌지.. 이런 시간은 프로젝트 기간에 계산되지 않아는데....