连接到具有数据库密码的 Access 数据库 [英] Connecting to an Access database that has a database password

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

问题描述

我用密码保护了一个 mdb 文件,但后来我无法在 vb.net 上访问它.我不知道定义密码的正确代码.这是我当前的代码,我知道它是错误的,但我也不知道正确的代码:

I've password protected an mdb file but then I cannot access it on vb.net. I don't know the correct code for defining the password. this is my current code, I know its wrong, but I don't also know the correct code:

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:search.mdb;pwd=nit"

推荐答案

conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:myFoldermyAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;" 

是连接字符串的正确格式.

is the correct format for your connection string.

查看 http://www.connectionstrings.com/access-2007 了解更多信息信息.

Check out http://www.connectionstrings.com/access-2007 for more info.

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

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