VS2010中用C#语句连接Access2010数据库问题
publicstaticstringconnStr="Provider=Microsoft.ACE.OLEDB.12.0;DataSource=C:\\DBSelectC...
public static string connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\DBSelectCourse.accdb";出现“ConnectionString中未指定OLEDB提供程序。示例为:“Provider=SQLOLEDB;”的错误,请问是怎么回事?
展开
2个回答
展开全部
string _strConn = @"provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + "Tabel1.accdb"; //access 2010
string _strConn = @"provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + "Tabel1.accdb"; //access 2003
string _strConn = @"provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + "Tabel1.accdb"; //access 2003
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询