无法使用C#连接到密码加密的MS Access 2016数据库 [英] Cannot connect to password encrypted MS Access 2016 database using C#

查看:369
本文介绍了无法使用C#连接到密码加密的MS Access 2016数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试连接到MS Access 2016数据库时,它无需密码即可完美连接,但是当我尝试用密码加密后连接到同一数据库时,出现此错误:

无法打开数据库.它可能不是您的应用程序可以识别的数据库,或者文件可能已损坏.

我不知道该怎么办-我的数据库未损坏,我必须使用密码进行设置.有办法吗,还是我在某些方面做错了?

文件扩展名是.accdb

屏幕截图:

https://drive.google.com/open?id=1vhp7pID4iQ_zoc6ImWXoJDFQv10qNRRn

https://drive.google.com/open?id=18QbuFhDU11YuYS -Pe1jxxIhtLPeff-lC

解决方案

按如下所示希望您的连接字符串,

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

因此,您使用了Microsoft.ACE.OLEDB.12.0 driver,并且必须安装在计算机上,因为Windows不附带.您可以在此链接上找到驱动程序

希望这个

如何使用访问连接字符串: https://www.connectionstrings.com/access/

When I try to connect to a MS Access 2016 database, it connects perfectly without password, but when I try to connect to the same database after encrypting it with a password, I get this error:

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

I don't know what I should do - my database isn't corrupted, and I have to make it with a password. Is there a way to do it, or am I wrong in something?

File extension is .accdb

Screenshots:

https://drive.google.com/open?id=1vhp7pID4iQ_zoc6ImWXoJDFQv10qNRRn

https://drive.google.com/open?id=18QbuFhDU11YuYS-Pe1jxxIhtLPeff-lC

解决方案

Hope your connection string as follows,

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

So, you used Microsoft.ACE.OLEDB.12.0 driver and must be installed on your machine, as it doesn't come with windows. you can find the driver on this link

And hope this post also help to you. and also this

How to use access connection strings: https://www.connectionstrings.com/access/

这篇关于无法使用C#连接到密码加密的MS Access 2016数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆