The 'Microsoft.Jet.OLEDB.4.0Data Source=C:\Users\Cod\Desktop\Database1.mdb' provider

suju_26pro

Well-known member
Joined
May 4, 2011
Messages
48
Programming Experience
Beginner
Dim dbprovider As String = "Provider=Microsoft.Jet.OLEDB.4.0"
Dim datasourse As String = "Data Source=C:\Users\Cod\Desktop\Database1.mdb"
con.ConnectionString = dbprovider & datasourse
con.Open() 'here i get errror

how do i come out of it..i hd searched in google for it they say to compile in 32 bit , but my os is window 7, and vs2008 does not give me 32 bit support , plz help me ....:confused:
 
I'm not convinced that you really looked because the difference is fairly obvious. Does it not make you suspicious that you are setting the provider like this:
VB.NET:
Dim dbprovider As String = "Provider=[U][B]Microsoft.Jet.OLEDB.4.0[/B][/U]"
and then the error message tells you this:
The 'Microsoft.Jet.OLEDB.4.0Data Source=C:\Users\Cod\Desktop\Database1.mdb' provider
I suggest that you go back to connectionstrings.com and have another look and actually compare it to yours.

You might also consider using an OleDbConnectionStringBuilder to build a connection string from parts.
 
there is no such word Microsoft.Jet.OLEDB.4.0Data Source in that website
Exactly, he's hinting at how the parts of the connection string are separated by a semi-colon and you're not putting one in, which is why it's failing, the Jet engine can't parse it.
 
Back
Top