简体   繁体   English

将C#应用程序连接到MS Access 2013 DB

[英]Connecting C# Application to MS Access 2013 DB

I'm using VS 2012 & Office 2013 64 bits, and i changed the target platform to x86, but I still got this weard error 我使用的是VS 2012和Office 2013 64位,并且我将目标平台更改为x86,但仍然出现此磨损错误

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine". “ Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册。

You need to download two components: 您需要下载两个组件:

1) microsoft access database engine 2) Office System Driver: Data Connectivity Components 1)Microsoft Access数据库引擎2)Office System驱动程序:数据连接组件

After these installations your application will start to work. 这些安装完成后,您的应用程序将开始运行。 Furthermore, following link is better to use on access to database: 此外,以下链接最好用于访问数据库:

void test()
{ 
string connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\\Database1.accdb;Persist Security Info=False;";
            OleDbConnection conn = new OleDbConnection(baglantiCumlesi);
            conn.Open();
            conn.Close();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM