简体   繁体   English

MS Access / accdb“无法打开数据库”错误(C#)

[英]MS Access/accdb “Cannot open database” error (C#)

I'm using an MS Access database to store data for a desktop application. 我正在使用MS Access数据库存储桌面应用程序的数据。 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. 我浏览了5页的Google搜索结果,试图找到解决方案,却一无所获。 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). 我能找到的每个答案都是2GB限制(我的数据库距离不远)或损坏(不是这种情况,因为只有两个新用户收到此错误,其他所有人都可以)。

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. 请指教。

Your connection string indicates that you are using the Microsoft.ACE.OLEDB.12.0 driver. 您的连接字符串表示您正在使用Microsoft.ACE.OLEDB.12.0驱动程序。

This must be installed on the machine, as it doesn't come with windows. 它必须安装在计算机上,因为它没有Windows。

You can find the driver in the Microsoft Access Database Engine 2010 Redistributable 您可以在Microsoft Access Database Engine 2010 Redistributable中找到驱动程序

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. 它可能不是您的应用程序可以识别的数据库,或者该文件可能已损坏 ,请确保数据库文件(ACCDB / MDB)的容量不超过2GB,因为这是任何Access数据库文件的限制。

Reference Here 这里参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM