Results 1 to 3 of 3

Thread: [RESOLVED] Error connecting to Jet database

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Resolved [RESOLVED] Error connecting to Jet database

    Using this code:

    Public Class Form1
    Private Sub cmdOpenDatabase_Click(sender As Object, e As EventArgs) Handles cmdOpenDatabase.Click
    Dim cn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;DataSource=C:\Data\TestDb.mdb")
    cn.Open()
    If cn.State = ConnectionState.Open Then
    MsgBox("Database open SUCCEEDED.")
    cn.Close()
    Else
    MsgBox("Database open FAILED.")
    End If
    End Sub
    End Class

    The solution compiles without error, but when it executes the cn.Open() statement it fails with this error:

    System.Data.OleDb.OleDbException: 'Could not find installable ISAM.'

    What am I doing wrong?

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: Error connecting to Jet database

    Turns out that DataSource must be rendered as Data Source [with a space].

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] Error connecting to Jet database

    Duh, I didn't notice that. Explains it all.

Tags for this Thread

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