ADOQuery1.close;
ADOQuery1.sql.text:="
          UpDate star
            set User=Char(39)+edit1.text+Char(39)+','   //User为String型
            password=Char(39)+edit2.text+Char(39)','  //password为String型
            QX=1 //QX为integer型
          where User=Char(39)+admin+Char(39)";
ADOQuery1.open;
=========================================
在运行的时候说我UpDate语发错误,可是在别的窗体上就行,不知道是为什么??

解决方案 »

  1.   

    password那一行末尾不对,应该是少了个“+”。
    你不可能编译通过的。
      

  2.   

    试试这个:
    ADOQuery1.close;
    ADOQuery1.sql.text:='UpDate star  set User='''+edit1.text+''',password='''+edit2.text+''''+' where User='''+admin+'''';
    QX=1 //QX为integer型
    ADOQuery1.exec;
      

  3.   

    各位大哥,我现在在网吧,写错是很我可能的。我的代码能通过,可是当更新数据的时候,就说我的UpDate语发错误。还有那个ADOQuery1.exec,我试过,不好用。楼上那个,你写错了,在写'''的地方,应该写'''',你少写了一个。