废话不多点的NetConnection字符串与Access 2007 [英] Ado dot netconnection String with Access 2007
本文介绍了废话不多点的NetConnection字符串与Access 2007的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想与Access连接使用ADO网使用以下code 2007ACCDB的文件,但我得到的错误无法识别的数据库格式
,什么可以是可能的原因?
OleDbConnection的康恩=新
的OleDbConnection(提供程序= Microsoft.Jet.OLEDB.4.0;
数据源= C:/MyWorkers.accdb);
尝试
{
conn.Open();
的MessageBox.show(已连接);
}
赶上(例外前)
{
的MessageBox.show(ex.Message);
}
解决方案
您可以使用 Microsoft.ACE.OLEDB.12.0
提供商,看到的 http://www.connectionstrings.com/access-2007 可作为办公室<一部分href="http://www.microsoft.com/downloads/en/details.aspx?familyid=7554f536-8c28-4598-9b72-ef94e038c891&displaylang=en"相对=nofollow> 2007系统驱动程序软件包。
I am trying to connect with Access 2007 "accdb" file using ADO net using the following code, but i am getting the error Unrecognized Database format
, What can be the possible reason for this?
OleDbConnection conn = new
OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;
Data Source=C:/MyWorkers.accdb");
try
{
conn.Open();
MessageBox.Show("Connected");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
解决方案
You can use the Microsoft.ACE.OLEDB.12.0
provider, see http://www.connectionstrings.com/access-2007 available as part of the office 2007 system driver package.
这篇关于废话不多点的NetConnection字符串与Access 2007的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文