try
            {
                string mycon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb";
                string temp = "insert into user (username, password, email) values ('a','b','c') ";
                this.oleDbConnectionTest.ConnectionString = this.mycon;
                this.oleDbConnectionTest.Open();
                MessageBox.Show(temp);
                oleDbCommandTest.CommandType = CommandType.Text;
                oleDbCommandTest.CommandText = temp;
                oleDbCommandTest.Connection = oleDbConnectionTest;
                //oleDbDataAdapterTest.InsertCommand = oleDbCommandTest;                //oleDbDataAdapterTest.Update(testDataSet.Tables["user"]);
                oleDbCommandTest.ExecuteNonQuery();
                //oleDbDataAdapterTest.InsertCommand.ExecuteNonQuery();
            }
            catch(Exception ee) {
                MessageBox.Show(ee.ToString());
            }

解决方案 »

  1.   

    try:string temp = "insert into [user] ([username], [password], [email]) values ('a','b','c') ";
      

  2.   

    user是MS SQL的關鍵字,前後要用[]括起來。
      

  3.   

    insert into [user] (username, password, email) values ('a','b','c')
      

  4.   

    user password 在ACCESS中是关键字,用[]括起来 或者改下别的名字就OK了
      

  5.   

    access就是要比SQL Server要烦些,楼上正解
      

  6.   

    string temp = "insert into [user] (username, [password], email) values ('a','b','c') ";
      

  7.   

    看錯了,開始沒注意環境,以為是MS SQL的。這個語句在ACCESS中沒有問題的。你出現的錯誤提示是什麼?
      

  8.   

    谢谢各位。好了现在。就是因为user password是关键字。
      

  9.   

    zhangpuwei() ( ) 信誉:100  2007-08-07 09:38:37  得分: 0  
     
     
       谢谢各位。好了现在。就是因为user password是关键字。
      
    -----------------? 你的是在ACCESS中的嗎?如果是在MS SQL中,這些是要處理下的。但是我剛在ACCESS中測試了下,你這段代碼是OK的。