是啊。。在sql里是没有strtoint函数的。。你把它用引号引上试试。。

解决方案 »

  1.   

    应该是:(注意区别)
    'update jg_hlqs set yy_shouru=' + edit23.Text + ' ,dj_shouru=' + edit24.Text + ',keping=' + edit25.Text + ',fapai=' + edit26.Text + ',qt_kaoping= ' + edit27.Text'
      

  2.   

    你的思路不对,SQL是个字符串,你想写的SQL应该是:
    update jg_hlqs set yy_shouru=1,...  这样的,所以你的语句应该这么写:
    query1.sql.add('update jg_hlqs set yy_shouru='+edit23.Text
      +',dj_shouru='+edit24.Text+',keping='+edit25.Text
      +',fapai='+edit26.Text'+',qt_kaoping='+edit27.Text ');
    query1.sql.add('where bumen='''+combobox4.text+'''');
      

  3.   

    在SQL里没有 strtoint()这个函数,strtoint()是 delphi 的,SQL语句应该如下
    query1.sql.add('update jg_hlqs set yy_shouru='+ edit23.Text +',dj_shouru='+
                    edit24.Text + ',keping='+edit25.Text + ',fapai='+
                    edit26.Text+',qt_kaoping='+ edit27.Text);
      

  4.   

    哈哈,你可以这样
    a := strtoint(edit23.Text);
    b := strtoint(edit24.Text);
    c := strtoint(edit25.Text);
    d := strtoint(edit26.Text);
    e := strtoint(edit27.Text);
    query1.sql.add('update jg_hlqs set yy_shouru=a,dj_shouru=b,keping=c,fapai=d,qt_kaoping=e ');
    如果是字符型,别忘''''
      

  5.   

    query1.close;
    query1.sql.Clear ;
    query1.sql.add('update jg_hlqs set yy_shouru='+edit23.Text+',dj_shouru='+edit24.Text+',keping='+edit25.Text+',fapai='+edit26.Text+',qt_kaoping='+edit27.Text);
    query1.sql.add('where bumen='''+combobox4.text+'''');
    query1.EXECSQL;错误提示:
    Gereral Sql error.
    [Microsoft][ODBC Microsoft Access Driver] too few parameters.expected 1.
    急待解决  
      

  6.   

    还有两行:
    query1.ApplyUpdates ;
    query1.CommitUpdates ;to cszhz(丑小鸭):
    错误提示:
    Gereral Sql error.
    [Microsoft][ODBC Microsoft Access Driver] too few parameters.expected 1.
      

  7.   

    给你一个例子:
    with UpdateQuery do begin
       Close;
       SQL.Clear;
       SQL.ADD('update Table set field=:P1 where Field2=:P2');
       Parameters.ParamByName('P1').Value:=Edit1.Text;
       Parameters.ParamByName('P2').Value:=Edit2.Text;
       ExecSQL;
    end;
    你的语句用上面方法套用就行了,给分
      

  8.   

    query1.sql.add('update jg_hlqs set yy_shouru='+edit23.Text+',dj_shouru='+edit24.Text+',keping='+edit25.Text+',fapai='+edit26.Text+',qt_kaoping='+edit27.Text);
    query1.sql.add(' where bumen='''+combobox4.text+'''');注意:where 前面的空格
    教你个好方法,string sql = 'update jg_hlqs set yy_shouru='+edit23.Text+',dj_shouru='+edit24.Text+',keping='+edit25.Text+',fapai='+edit26.Text+',qt_kaoping='+edit27.Text + ' where bumen='''+combobox4.text+''''ShowMessage(sql);先看一看,要执行的sql 是什么,一目了然,错误很容易找到。
      

  9.   

    看一下你的sql语句,同意jeaking(空空) 的观点,你的sql有问题。
      

  10.   

    to yyb2000(三流编程机器):
    不好意思- UpdateQuery是什麽
      

  11.   

    query1.sql.add('update jg_hlqs set yy_shouru='+edit23.Text+',dj_shouru='+edit24.Text+',keping='+edit25.Text+',fapai='+edit26.Text+',qt_kaoping='+edit27.Text);
    query1.sql.add(' where bumen='''+combobox4.text+'''');注意:where 前面的空格
    教你个好方法,string sql = 'update jg_hlqs set yy_shouru='+edit23.Text+',dj_shouru='+edit24.Text+',keping='+edit25.Text+',fapai='+edit26.Text+',qt_kaoping='+edit27.Text + ' where bumen='''+combobox4.text+''''ShowMessage(sql);先看一看,要执行的sql 是什么,一目了然,错误很容易找到。
      

  12.   

    我试了,where 前面的空格
    但还是
    错误提示:
    Gereral Sql error.
    [Microsoft][ODBC Microsoft Access Driver] too few parameters.expected 1.
      

  13.   

    query1.sql.add('where bumen=''''+combobox4.text+''''');
      

  14.   

    updateQuery 就是你的query1呀,控件的名字而已
      

  15.   

    to : yyb2000(三流编程机器) 
    按你说的做:
    错误提示:
    Gereral Sql error.
    [Microsoft][ODBC Microsoft Access Driver] too few parameters.expected 6。
    原来是expected 1。
      

  16.   

    query1.close;
    query1.sql.Clear ;
    query1.SQL.add('select * from zhjzh_hlqs where bumen='''+combobox3.text+'''');
    query1.Open;
    query1.Edit;
    query1.fieldbyname('yy_shouru3').value :=edit12.Text;
    query1.fieldbyname('dj_shouru6').value :=edit13.Text;
    query1.fieldbyname('tingshi11').value :=edit14.Text;
    query1.fieldbyname('anquan12').value :=edit15.Text;
    query1.fieldbyname('bz_kaoping13').value :=edit16.Text;
    query1.fieldbyname('zhizhen14').value :=edit17.Text;
    query1.fieldbyname('jieneng15').value :=edit18.Text;
    query1.fieldbyname('qtzhb_kaohe16').value :=edit19.Text;
    query1.fieldbyname('hl_butie17').value :=edit20.Text;
    query1.fieldbyname('qt18').value :=edit21.Text;
    query1.fieldbyname('qt19').value :=edit22.Text;
    query1.ApplyUpdates ;
    query1.CommitUpdates ;提示:could not find object