Home > Database > Mysql Tutorial > C#连接Access2013

C#连接Access2013

WBOY
Release: 2016-06-07 15:43:43
Original
1218 people have browsed it

今天测试 连接 Access2013数据库,遇到错误,综合几个大神建议,解决了 我的系统是windows 2008 64位的, 连接 字符串如下: 1 connectionStrings 2 add name= " TestConn " connectionString= " Provider=Microsoft.ACE.OLEDB.12.0;Data Source= 3 E:\data\

今天测试连接Access2013数据库,遇到错误,综合几个大神建议,解决了

我的系统是windows 2008 64位的,连接字符串如下:

<span>1</span>   <connectionstrings>
<span>2</span>     <add name="<span">"<span>TestConn</span><span>"</span> connectionString=<span>"</span><span>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=</span>
<span>3</span>          E:\data\Test.accdb;Persist Security Info=<span>false</span><span>"</span><span>/></span>
<span>4</span>   </add></connectionstrings>
Copy after login

注意:这里的Provider不是Microsoft.Jet.OLEDB.12.0,将Jet改为ACE

但是当我运行时走到打开连接这一步时出错了,提示如下:

C#连接Access2013

然后在CSDN上搜了一下,发现是项目属性问题,因为我的系统是64位的,需要将生成中的“首选32位”勾选掉才行

C#连接Access2013

然后再运行,正确,取得数据!

C#连接Access2013

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template