Connect to Access database with database password

My password is protected by the mdb file, but then I can’t access it on vb.net. I do not know the correct code to determine the password. this is my current code, I know it incorrectly, but I also do not know the correct code:

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\search.mdb;pwd=nit" 
+4
source share
2 answers
 conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;" 

- The correct format for your connection string.

For more information, see http://www.connectionstrings.com/access-2007 .

+6
source

I believe the connection string should look like this:

 conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:Database Password=MyDbPassword;" 

Here is a link to a site that can help with connection string questions ConnectionStrings.Com HTH

+4
source

All Articles