Your file extension for the access database should be .mdb not .mbd I'd start there.
Also there should be no space after the semicolon. I also never have a space before or after my equal sign.
Try the following:
Dim con as New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=pract.mdb")
Phasma
Junior Poster in Training
81 posts since Nov 2008
Reputation Points: 21
Solved Threads: 21
Maybe you have to write the full path to the database:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\Folder1\Folder2\LocalAccess40.mdb"
Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474
Put the following in your code window with the Imports System.Data.OleDb and run it maybe from the Form Load event.
Private Sub TEST()
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=pract.mdb")
Try
con.Open()
Catch ex As Exception
MsgBox(ex.ToString)
Finally
con.Close()
End Try
End Sub End Try
If there is an exception, you will see it in the Message Box and be able to determine what is wrong.
Phasma
Junior Poster in Training
81 posts since Nov 2008
Reputation Points: 21
Solved Threads: 21