Results 1 to 4 of 4

Thread: ODBC Connection

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    ODBC Connection

    I'm using an ODBC connection to connect to a SyBase Table. I connect to the DB ok, but It wont let me run a query. I get this error message on the line: objDR = cmd.ExecuteReader

    Value of type 'Microsoft.Data.Odbc.OdbcDataReader' cannot be converted to 'System.Data.OleDb.OleDbDataReader'.

    VB Code:
    1. Dim cn As OdbcConnection
    2.         cn = New OdbcConnection("DSN=SBPROD;Server=SYBASE;DB=fmsprod;Password=test;User ID=test")
    3.         Dim cmd As New OdbcCommand(sqlcmd)
    4.         Try
    5.             cn.Open()
    6.             objDR = cmd.ExecuteReader
    7.             If objDR.Read = True Then
    8.                 gerror_flag = True
    9.             Else
    10.                 gerror_flag = False
    11.             End If
    12.             cn.Close()
    13.         Catch ex As Exception
    14.             MsgBox(Err.Description)
    15.         End Try

    All I'm trying to do is see if any records are being retured...just a EOF test.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Make sure objDR isn't declared as an OledbDataReader on accident.

  3. #3

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    Edneeis can I have your brain....thanks, that was the prob...

  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width