[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?
Re: Error connecting to Jet database
Turns out that DataSource must be rendered as Data Source [with a space].
Re: [RESOLVED] Error connecting to Jet database
Duh, I didn't notice that. Explains it all.