Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to an Access database that has a database password

I've password protected an mdb file but then I cannot access it on vb.net. I don't know the correct code for defining the password. this is my current code, I know its wrong, but I don't also know the correct code:

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\search.mdb;pwd=nit"
like image 374
user225269 Avatar asked Dec 30 '22 05:12

user225269


1 Answers

conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;" 

is the correct format for your connection string.

Check out http://www.connectionstrings.com/access-2007 for more info.

like image 192
Steve Strickland Avatar answered Jan 13 '23 01:01

Steve Strickland