如何向尝试连接到 MS Access 数据库的 JDBC:ODBC 连接字符串添加密码
这是当前在无密码保护的 MS Access 数据库上工作的连接字符串。
此代码片段来自我们的属性文件:
db.url = jdbc:odbc:Driver\={Microsoft Access Driver (*.mdb)};Dbq\=C:\Inventory.mdb;DriverID\=22;READONLY\=true
如何为受数据库密码(非 ULS)保护的 MS Access DB 添加密码到此连接字符串?
谢谢!
This is the connection string that is currently working on a non-password protected MS Access database.
this code snippet is from our properity file:
db.url = jdbc:odbc:Driver\={Microsoft Access Driver (*.mdb)};Dbq\=C:\Inventory.mdb;DriverID\=22;READONLY\=true
How do I add a password to this connection string for a MS Access DB protected by a database password (Non-ULS)?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从这里引用:Java 支持
Referenced from here: Java Support
要处理受密码保护的 MS Access 数据库 2003/2007,请使用下面的代码片段
我的连接字符串 url 是,
并且在连接到 MS Access 数据库时遇到一个问题,堆栈跟踪如下。
为了解决这个问题,我简单地删除了 url 字符串中的 "DriverID=22;READONLY=true;" ,问题就解决了:)
我已经在受密码保护的 MS Access 2003 和 2007 数据库上测试了给定的代码片段,并且运行良好。
希望对做新的实验有帮助。
To work on password protected MS Access Database 2003/2007 use the below code snippet
My connection string url was
and I was facing one problem while connecting to MS Access Database the stack trace as below.
To overcome this problem simply I removed the "DriverID=22;READONLY=true;" in url string and the problem get solved :)
The given code snippet I have tested on password protected MS Access 2003 and 2007 Database and work well.
Hope that it will helpful to do new experiment.
我知道您要求使用 ODBC,但是不可能使用 OLEDB,如 ConnectionStrings 上提供的连接字符串。 com:
我不知道 Jet ODBC 驱动程序是否提供了对数据库密码的任何支持,直到 Jet 4 才引入数据库密码(并且在 Access/Jet/ACE 的任何版本中完全没有价值)。
I know you're asking for ODBC, but is it impossible to use OLEDB, as in the connect string provided on ConnectionStrings.com:
I don't know that the Jet ODBC driver provides any support for database passwords, which were not introduced until Jet 4 (and are completely worthless in any version of Access/Jet/ACE).