利用本身的连接功能,最后代码如下:
string execd="delete from user where id=2";
this.oleDbConnection1.Open();
this.oleDbDeleteCommand1=new OleDbCommand(execd,this.oleDbConnection1);
this.oleDbDeleteCommand1.ExecuteNonQuery();
this.oleDbConnection1.Close();
MessageBox.Show("ok");我想问题是在access连接上或者安全,但搜索很久不行
string execd="delete from user where id=2";
this.oleDbConnection1.Open();
this.oleDbDeleteCommand1=new OleDbCommand(execd,this.oleDbConnection1);
this.oleDbDeleteCommand1.ExecuteNonQuery();
this.oleDbConnection1.Close();
MessageBox.Show("ok");我想问题是在access连接上或者安全,但搜索很久不行
at system.data.oledb.oledbcommand.executecommandtexterrorhandling(Int32 hr)
at system.........................executecommandtextforsingleresult(tagdbparams dbparams,object&executeresult)
...........
string execd="delete from [user] where id=2";
this.oleDbConnection1.Open();
this.oleDbDeleteCommand1=new OleDbCommand(execd,this.oleDbConnection1);
this.oleDbDeleteCommand1.ExecuteNonQuery();
this.oleDbConnection1.Close();
MessageBox.Show("ok");如果這樣還不行請把user表名換一個名字比如userInfo就可以了
在Access 2003 里,最好不用一特殊性的名子与表名
如User , NAME,PASSWORD
不然会出错完全正确,改表名
我怎么会犯这样的笨错误
害的我装了一遍office,结果现在老说初始化字符串不符合oledb规定