数据库:Test.mdb  //数据库密码是:123,与程序在同一目录
表:others
字段:
1.id  //id是自动编号,主键
2.userid  //文本类型;字段大小:5;必填字段:否;允许空字符串:否代码:                string strCon = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=Test.mdb;Jet OleDb:DataBase Password='123'";
                OleDbConnection con = new OleDbConnection(strCon);
                con.Open();
                string strUpdateOthers = " update others SET userid = '" + txtuserid.Text.Trim() + "' WHERE id = '1'";
                OleDbCommand cmdUpdate = new OleDbCommand(strUpdateOthers, con);
                cmdUpdate.ExecuteNonQuery();
                con.Close();真不知道错哪了,求各位大哥大姐帮帮忙,先谢谢了!数据库AccessUpdate至少有一个参数没有被指定值

解决方案 »

  1.   

    http://blog.csdn.net/xianfajushi/article/details/8548117
      

  2.   

     string strUpdateOthers = " update others SET userid = '" + txtuserid.Text.Trim() + "' WHERE id = '1'"; 
    改成
     string strUpdateOthers = " update others SET userid = '" + txtuserid.Text.Trim() + "' WHERE id = 1"; 
      

  3.   

     string strCon = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=Test.mdb;Jet OleDb:DataBase Password='123'" 
    请用绝对路径。
      

  4.   

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Test.mdb;Persist Security Info=True;Jet OLEDB:Database Password=123
    你的密码确认是123吧,如果是应该不用加引号的吧
    哈哈纠错队啊