Connecting to an Access database that has a database password

后端 未结 2 1034
轻奢々
轻奢々 2020-12-10 20:05

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 wro

相关标签:
2条回答
  • 2020-12-10 20:23
    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.

    0 讨论(0)
  • 2020-12-10 20:27

    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 讨论(0)
提交回复
热议问题