cant connect to ms access 2013 by password connection string

i working on project using c# and access 2013 , the wrong is : Cannot open database . It may not be a database that your application recognizes, or the file may be corrupt
i installed microsoft access2007 engine on my machine , if i testing the connection without password its works but with a password connection does not work . sorry for my english
my connection string like this :

<add name="con" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\\visitor_db.accdb;Jet OLEDB:Database Password=2015;"/>

please help me to connect with password .

2 answers

Hi,

I faced with the same issue recently, but it was with Access 2010. I'm sure that you have tried to compact and repair your Access database, save this database in a new file or create a new empty database and import the data from the old database.

My operating system is a Windows 7 64-bit, in this case you can have installed an ACE provider in 32-bit or 64-bit on your machine. After some tests, I realized that 32-bit applications and 64-bit ACE provider have problems with encrypted Access 2007 databases (accdb) and the new encryption mode available in the Microsoft Access 2010 which is based on 128 bit key encryption. As you may know, the 64-bit ACE provider is compatible with 32-bit and 64-bit applications, but you will get that error if your application is compiled in 32-bit.

So there are the right environments for encrypted databases (accdb type):

  • 32-bit Windows -> 32-bit ACE provider ->Your App has to be compiled for 32-bit environments.
  • 64-bit Windows -> 64-bit ACE provider -> Your App has to be compiled for 64-bit environments.

Other configurations have failed on my tests for encrypted Access 2007 databases (accdb).

Hope this helps!!!

Raul

thank you for answer , i fixed the problem , by encrypt database with microsoft access 2007 , its work correctly with access 2013 .