焦棚子的文章目录文章源自焦棚子-https://jiaopengzi.com/327.html
请在文末下载附件
文章源自焦棚子-https://jiaopengzi.com/327.html
一、
有朋友在问pq访问带密码的access的时候会报错,导致无法访问(如下图);文章源自焦棚子-https://jiaopengzi.com/327.html
1、选择更多文章源自焦棚子-https://jiaopengzi.com/327.html
2、选择Access数据库文章源自焦棚子-https://jiaopengzi.com/327.html
3、选择带密码的Access文件后,报错:密码无效,(如图3)。文章源自焦棚子-https://jiaopengzi.com/327.html
2、如上图用的Access.Database这个函数,无法访问带密码access的数据文章源自焦棚子-https://jiaopengzi.com/327.html
二、
既然无法调用,使用的odbc即可。文章源自焦棚子-https://jiaopengzi.com/327.html
1、选择更多文章源自焦棚子-https://jiaopengzi.com/327.html
2、选择其他>ODBC文章源自焦棚子-https://jiaopengzi.com/327.html
3、选择数据源名称为:MS Access Database文章源自焦棚子-https://jiaopengzi.com/327.html
4、在高级选项下,输入字符串:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\ALL\desktop\data.accdb文章源自焦棚子-https://jiaopengzi.com/327.html
5、输入用户名和密码文章源自焦棚子-https://jiaopengzi.com/327.html
6、选择数据文章源自焦棚子-https://jiaopengzi.com/327.html
7、得到结果文章源自焦棚子-https://jiaopengzi.com/327.html
8、Odbc.DataSource函数说明文章源自焦棚子-https://jiaopengzi.com/327.html
三、说明
1、建立空白查询,直接键入如下语句也是可以行的(需要输入验证)。文章源自焦棚子-https://jiaopengzi.com/327.html
Odbc.DataSource("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};
DBQ=C:\Users\admin\Desktop\test_pwd.accdb")
2、Odbc.DataSource函数第一个参数connetcionString(连接字符串),不能包含uid,pwd元素,需要在验证模块手动填写(数据安全的考虑)文章源自焦棚子-https://jiaopengzi.com/327.html
3、本案例中的连接字符串有两个元素,一个是access驱动器(driver),另外一个是路径或者叫做地址吧(dbq)文章源自焦棚子-https://jiaopengzi.com/327.html
4、自己访问数据的时候,就把dbq更改为自己的就好,填写用户名和密码;用户名默认为admin文章源自焦棚子-https://jiaopengzi.com/327.html
5、excel的pq访问同理文章源自焦棚子-https://jiaopengzi.com/327.html
文章源自焦棚子-https://jiaopengzi.com/327.html
by焦棚子文章源自焦棚子-https://jiaopengzi.com/327.html
焦棚子的文章目录文章源自焦棚子-https://jiaopengzi.com/327.html
请点击【立即购买】或者【升级VIP】获得案例附件。文章源自焦棚子-https://jiaopengzi.com/327.html
文章源自焦棚子-https://jiaopengzi.com/327.html
评论