I am working on an experimental project and have run into a problem trying to connect a microsoft access database to my program in visual basic 2008 express
and keep getting the following message when I try to make the connection.
"The 'Microsoft.Jet.OLEDB.4.0C:\Users\lewis\Documents\programming\programs\cadet stores program\squadron stores system V1.1\squadron stores system V1.1\stores database\213 squadron stores.mdb' provider is not registered on the local machine."
After some research I have seen that there may be an issue because I am using a 64 bit operating system with 32 bit software. Any help or suggestions I would be grateful
This is the method I am currently trying to use:
Dim con As New OleDb.OleDbConnection
Dim dbProvider As String
Dim dbSource As String
dbProvider = "Provider=Microsoft.Jet.OLEDB.4.0"
dbSource = "C:\Users\lewis\Documents\programming\programs\cadet stores program\squadron stores system V1.1\squadron stores system V1.1\stores database\213 squadron stores.mdb"
con.ConnectionString = dbProvider And dbSource
con.Open()
I have now re written the syntax as shown bellow:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim con As New OleDb.OleDbConnection
Dim connString As String
connString = "Provider = Microsoft.Jet.OLEDB.4.0;"
connString &= "C:\Users\lewis\Documents\programming\programs\cadet stores program\squadron stores system V1.1\squadron stores system V1.1\stores database\213 squadron stores.mdb;"
con.ConnectionString = connString
con.Open()
MessageBox.Show("Conection open")
End Sub
However I now get the following error message:
"Format of the initialization string does not conform to specification starting at index 35."
The connection now works many thanks for your help
many thanks
Lewis