3

I'm using an MS Access database to store data for a desktop application. This week I was asked to give access to the application to some additional users, but whenever they launch the application they are getting the error message:

Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt.

I have gone through 5 pages of Google search results trying to find a solution and come up with nothing. Every answer I can find to this problem is either the 2GB limit (which my db is nowhere near) or corruption (which is not the case because only two new users are receiving this error and everyone else is fine).

This is my connection string:

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=[Path];Jet OLEDB:Database Password=[Password];"

I'm pretty sure this is due to the users' machines missing something, but I cannot figure out what or where they can get it from. Please advise.

crthompson
  • 15,653
  • 6
  • 58
  • 80
Jdinklage Morgoone
  • 770
  • 1
  • 7
  • 20
  • Where is your connection string stored? In a config file? If in a file, are you sure they have access to it? – Brian Dec 23 '13 at 22:24
  • @Brian It's not stored in a config file. Having access to the connection string is not an issue. – Jdinklage Morgoone Dec 23 '13 at 22:27
  • Is your db located on a network share? Did you check the read/write permissions for those new users? – Steve Dec 23 '13 at 22:29
  • So, some users ARE able to access the database remotely? And these 2 users that cannot, they have Access on their machines and permission to the MDB file? – crthompson Dec 23 '13 at 22:29
  • 1
    You have a database password, which means it is encrypted. If that was done in Access 2010 or later without "legacy encryption", and the problem users all have Access 2007, that would account for the error. – HansUp Dec 23 '13 at 22:30
  • It is not required to have Access to use ACE.OleDB and read/write an accdb or mdb file – Steve Dec 23 '13 at 22:30
  • @Steve DB is on a network share, already confirmed read/write permissions are in order. – Jdinklage Morgoone Dec 23 '13 at 22:30
  • The `Cannot open database [empty string]` message says they cannot find the database or dont have permission to it. – crthompson Dec 23 '13 at 22:31
  • A quick test to exclude network problems could be moving the db on a local drive, change the connection and see what happens – Steve Dec 23 '13 at 22:32
  • @paqogomez Yes. All previous users are able to run the application and it accesses the database without issue. 2 of the 3 new users receive errors. I don't know if they have Access installed - does that actually matter when the application (written in C#, not Access) is what's accessing the DB? – Jdinklage Morgoone Dec 23 '13 at 22:32
  • 1
    Access drivers will be needed. – crthompson Dec 23 '13 at 22:33
  • The ACE 12 provider must come from somewhere; it is not included with Windows. So either you get it from MS Office installation or download and install it separately. If it came from Office 2007, perhaps has not been updated with support for newer Access 2010+ encryption. Maybe remove the password and test that version of the db file (with a revised connection string). – HansUp Dec 23 '13 at 22:35
  • Make sure they have the access redistributable http://www.microsoft.com/en-us/download/details.aspx?id=13255 – crthompson Dec 23 '13 at 22:35

2 Answers2

4

Your connection string indicates that you are using the Microsoft.ACE.OLEDB.12.0 driver.

This must be installed on the machine, as it doesn't come with windows.

You can find the driver in the Microsoft Access Database Engine 2010 Redistributable

crthompson
  • 15,653
  • 6
  • 58
  • 80
1

If the error is Cannot open database . It may not be a database that your application recognizes, or the file may be corrupt, make sure that the Database file (ACCDB/MDB) is not more than 2GB because that's the limit for any Access Database File.

Reference Here

Swati
  • 28,069
  • 4
  • 21
  • 41