Background Image

FORUM

조회 수 22252 추천 수 0 댓글 4
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
개발은 Visual Basic 6.0 으로 하고 있습니다

        aAdoCn.ConnectionString = "Provider = CUBRIDProvider;" & _
                                      "Data Source = " & aDataSource & ";" & _
                                      "Location = " & aIp & ";" & _
                                      "User ID = " & aUseID & ";" & _
                                      "Password = " & aPassword & ";" & _
                                      "Port = 30000;" & _
                                      "Fetch Size = 100"

다음과 같이 연결을 하고
ADO를 이용하여 조회를 하고 있는데
adors.Recordcount
adors.MoveNext 등 의 함수를 이용하면

데이터 공급자나 기타 서비스가 E_FAIL 상태를 반환했습니다 라고  에러가 발생합니다.


참고로 
            aAdoCn.ConnectionString = "driver={CUBRID Driver};" & _
                                      "server=" & aIp & ";" & _
                                       "port=33000;" & _
                                      "uid=" & aUseID & ";" & _
                                      "pwd=" & aPassword & ";" & _
                                     "db_name=" & aDataSource & ";"
이런 식으로 연결하면 정상적으로 실행이 됩니다.
  • ?
    손승일 2009.02.12 19:56
    recordset의 CursorLocation 속성의 값을 AdUseClient로 설정해보시기 바랍니다.
  • ?
    늘푸른거북이 2009.02.13 18:05
    답변 감사합니다
    CursorLocation 속성을 AdUseClient로 변경을 하였는데도 같은 에러가 발생을 하네요.
    혹시 제가 더 확인해 봐야 하는 부분이 있을까요?
  • ?
    늘푸른거북이 2009.02.13 18:05
    답변 감사합니다
    CursorLocation 속성을 AdUseClient로 변경을 하였는데도 같은 에러가 발생을 하네요.
    혹시 제가 더 확인해 봐야 하는 부분이 있을까요?
  • ?
    flypig 2009.02.12 20:36

    아래 테스트 코드를 작성하여 시험한 결과 문제 없이 작동을 하였습니다.
    기본적으로 OLEDB의 cursor location은 Server에 만들어지고 이때에 recordset의 count는 사용할 수 없습니다.
    recordset.recordcount를 사용하기 위해서는 cursor location을 클라이언트로 하고 질의를 수행해야 합니다.
    아래 코드를 참조하시기 바랍니다.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Private Sub Command1_Click()
        Dim adoConn As ADODB.Connection
        Dim adoRset As ADODB.Recordset
        Dim strConn As String
        Dim strSQL As String
       
        strConn = ""
       
        'make OLEDB connection string
        strConn = strConn & "Provider = CUBRIDProvider;"
        strConn = strConn & "Data Source = db_name;" ' database name
        strConn = strConn & "Location = server_ip;"  ' database server ip address
        strConn = strConn & "User ID = user_id;"     ' database user id
        strConn = strConn & "Password = user_passwd;" ' database user id's password
        strConn = strConn & "Port = 33000;"          ' broker port
        strConn = strConn & "Fetch Size = 100;"

        ' connect to database with ado connection object
        Set adoConn = New ADODB.Connection
        With adoConn
            .ConnectionString = strConn
            .ConnectionTimeout = 30
            .Properties("Prompt") = adPromptNever
            .CursorLocation = adUseClient ' default valuse is adUseServer
            .Open
        End With
       
        ' create SQL statement and run the SQL
        strSQL = " select client_id, client_name from css_client where rownum < 101 "
       
        Set adoRset = adoConn.Execute(strSQL, , adCmdText)
       
        If adoRset.EOF Then
            MsgBox "No data found...", vbInformation + vbOKOnly, "Notify"
           
            If Not adoRset Is Nothing Then
                adoRset.Close
                Set adoRset = Nothing
            End If
            Exit Sub
        End If
        ' display select record count
        MsgBox adoRset.RecordCount, vbInformation + vbOKOnly, "notify"
       
        ' display data on spread sheet
        With vaSpread1
       
            While Not adoRset.EOF
                .MaxRows = .MaxRows + 1
                .Row = .MaxRows
               
                .Col = 1
                .Text = adoRset(0)
               
                .Col = 2
                .Text = adoRset(1)
               
                adoRset.MoveNext
            Wend
        End With
       
    End Sub


List of Articles
번호 제목 글쓴이 날짜 조회 수
공지 CUBRID 사용자를 위한 DBeaver 도구 출시 안내 admin 2024.04.23 48
공지 SQLGate for CUBRID 영구 무료 라이선스 제공 file admin 2020.04.09 4458
3874 ADO.NET에서 자바 저장함수 호출 2 kdknim21 2014.11.01 8420
3873 ADO.Net 사용중입니다. 상태확인 방법을 알고 싶습니다. 1 CUCUCUCU 2015.10.22 5691
3872 ADO.net Driver 변경 시 cascci.dll 로드할 수 없다는 오류 1 물병 2017.07.25 503
3871 ADO.net 또는 ODBC에 대한 질문입니다. 12 세스카 2012.03.20 13377
3870 ADO이용시 OLEDB Driver에러 2 flypig 2010.01.29 15619
3869 AIX에 CUBRID 설치 후 오류사항 문의 1 최명호 2015.06.02 7735
3868 ALTER 로 PK 여러 개 지정하고싶습니다 4 사탕구름 2021.07.21 832
3867 ARRAY 데이터 타입에 대한 SQL 질문 3 지용 2010.10.08 10246
3866 AUTO INCREASE 가 편집이 안됨 2 file 큐브리드어려워요 2022.02.08 268
3865 AUTO_INCREMENT 수동 증가 문의 2 cubrid초보 2021.08.19 727
3864 AUTO_INCREMENT 컬럼 이용시 2 hyperhand 2009.12.22 17649
3863 AVG 함수관련 질문드려요 1 구름마음 2013.06.10 13678
3862 Ado.NET : Cannot connect to CUBRID CAS 오류 2 websiter 2017.05.05 57860
3861 Ado.net. ExecuteNonQuery의 반환값이 항상 0 입니다. 2 모비23 2019.01.08 1480
3860 An IOException was caught during reading the inputstream 1 익명2 2015.11.26 6872
3859 An IOException was caught during reading the inputstream 1 익명2 2015.11.26 6831
3858 An IOException was caught during reading the inputstream. 오류 조치방법 좀 알려주세요. 1 ldev27 2019.10.29 314
3857 An internal error occurred during: "Fetching children of <DB명>". java.lang.NullPointerException 에러 4 ysh 2021.04.06 481
3856 Apm_setup7로 자동설치시 연동이 안되는데... 1 또랑 2010.11.08 8277
3855 Archive Log만으로 타임복구가 가능한가요? 4 핑핑크 2016.04.29 9820
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 ... 200 Next
/ 200

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales