你试一下,在表名上加[]
INSERT INTO [Friends]

解决方案 »

  1.   

    加了[]也不行,我怀疑这些语句有很大问题...(Name,Sex,Age,Telephome,Address_Home,Address_Inc,Note)VALUES(";
    strInsert+=this.textName .Text + ",'";
    strInsert+=this.textSex.Text + "','";
    strInsert+=this.textAge .Text + "',";
    strInsert+=this.textTelephome.Text +"',";
    strInsert+=this.textHomeAddress .Text  +"'.";
    strInsert+=this.textIncAddress .Text +"',";
    strInsert+=this.textNote .TabIndex +")";
      

  2.   

    你中间少了几个单引号!
    string strInsert="INSERT INTO Friends(Name,Sex,Age,Telephome,Address_Home,Address_Inc,Note)VALUES('";
    strInsert+=this.textName.Text + "','";
    strInsert+=this.textSex.Text + "','";
    strInsert+=this.textAge.Text + "','";
    strInsert+=this.textTelephome.Text +"','";
    strInsert+=this.textHomeAddress .Text  +"','";
    strInsert+=this.textIncAddress .Text +"','";
    strInsert+=this.textNote .TabIndex +"')";
    上面已经把'添加完成,另外,有个地方你把,输成了.,所以会出错。
      

  3.   

    你把最后生成的sql语句弄出来,在access上查询看看有没有错误就知道了
      

  4.   

    这种问题最好的办法就象cforce说的那样
    把那个sql字符串打印出来看比较清楚!
      

  5.   

    提个小醒,这样子hard codeing的sql语句很容易受到Cross Site Scripting的攻击,例如你那个textIncAddress的值我填一个这样的字符串:
    abcd','1') delete friends --
    这样你的表就完啦