Search code examples
c#.netdatabaseado.netoledb

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


I have the following connection string using ado.net

String ConectionString=@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Data.accdb; Jet OLEDB:Database Password=mypassword;"

I faced the problem Microsoft.ACE.OLEDB.12.0 is not registered on local Machine

I solved it By installing 64 version of the Microsoft Access Database Engine 2010. And edit Build Properties to x 86 But it never worked so I had to install 2007 Office System Driver :Data Connectivity components When I installed the last one the problem disappeared But I faced a new problem

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

That is my problem now any help please? The three solutions I followed are found in this amazing video https://www.youtube.com/watch?v=uzLA_z7tDPs

sorry i forgot the most important information which is i am using Microsoft office plus 2013 and i installed AccessRuntime_x64_en-us for office 2013 but it never works too


Solution

  • I have the same issue and I solved it right now.

    The solution is to build a new Database by using the new version of Office we have.

    Also you should install (Microsoft Access Database Engine) that has no. of bits (32 or 64) just like your Office and everything will work.