开发者

Connecting to an Access database that has a database password

开发者 https://www.devze.com 2022-12-16 17:08 出处:网络
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.

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 c开发者_JAVA技巧ode, 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"


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.


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 which can help with connection string questions ConnectionStrings.Com HTH

0

精彩评论

暂无评论...
验证码 换一张
取 消