c#连接access 报错 不支持关键字: “provider”
问题如题,
代码如下
string constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=eworld.mdb;Jet OLEDB:Database Password=''";
SqlConnection conn = new SqlConnection(constr);//进行连接时就会报错 不支持关键字: “provider”。
连接串是 用.net自带的数据组建生成的。
到网络上搜,有人说是需要安装 MDAC.inf。 按照提示安装了之后还是报这个错误。
不知道有没有高手能帮忙解决。
http://www.cftea.com/c/2007/07/V5CXEBU0V5VDJ3D5.asp
楼上给的网址提示去掉 Provider,
但是去掉之后报错不支持关键字: “jet oledb:database password”。
还是不行
帮你顶下
哪位大侠来帮帮我啊,分数不够我可以再加
试试
C# code:
region Access 2007
Console.WriteLine("Access 2007");
string strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;";
strConnection += @"Data Source=C:\Documents and Settings\v-changl\My Documents\Database1.accdb;";
strConnection += "Persist Security Info=False";
using (OleDbConnection objConnection = new OleDbConnection(strConnection))
{
objConnection.Open();
OleDbDataAdapter myCommandd = new OleDbDataAdapter("select * from Couse", objConnection);
相关问答:
//C 接口
extern "C"
{
TESSDLL_API int __cdecl GetTessText(const char *imagefile, char *text);
}
//我在C#中声明
//调用C DLL 中的函数
[DllImport("OCRapi.dll&quo ......
IsSqlDataBase = 0 '主数据库类型(1=SQL,0=AC)
'===========================================================================
SqlDatabaseName = "ads365" '主数据库名
S ......
access 中执行sql update语句时有时候成功有时候不成功,但是access中不出错误信息,不知道是什么原因,有哪位大侠知道,请帮忙啊
贴SQL语句,检查表、字段的有效性设置
sql 在查询分析器里面 执行很正常
是 ......
(1)string ConnString = "server=localhost;integrated security=sspi;database=pubs;";
(2)string strConnection="user uid=sa;pwd=123456;Database=test;Server=test;Connect ......
有个winform程序,使用c#+mysql,需要在一个窗体设置mysql自动删除功能,包括自动删除多少天之前的数据以及是否开启自动删除功能,我程序退出后,还怎么控制Mysql自己删除啊?是不是要用mysql的event来实现?c#可以调用mysq ......