-
Sep 29th, 2021, 12:11 PM
#1
Thread Starter
Lively Member
[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?
-
Sep 29th, 2021, 04:09 PM
#2
Thread Starter
Lively Member
Re: Error connecting to Jet database
Turns out that DataSource must be rendered as Data Source [with a space].
-
Sep 29th, 2021, 04:16 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|