Results 1 to 2 of 2

Thread: Connecting through OLEDB

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    11

    Connecting through OLEDB

    I'm having trouble connecting though OLEDB. I've attached my code below and the err I'm getting. What's the reason why I can't seem to connect.

    Code:
    Dim cn As OleDb.OleDbConnection
            Dim strDSN As String
            Dim dsn As String
    
            dsn = "Rebates"
            strDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dsn
            cn = New OleDb.OleDbConnection(strDSN)
            cn.Open()
    
            cn.Close()
    my error is ...

    An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

    I'm using ODBC and Rebates is my DSN

    Thanks.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    for ODBC dbs , use ODBC provider .

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