语句如下:
with adoquery_jtxmdjb do
   begin
    close;
    sql.clear;
    sql.add('update xmzaiyan set zzjf='+strtocurr(edit_zzje.Text)+'where xmlxbh='''+edit_xmpzh.Text+'''');
    ExecSQL;
   end;
 
在 sql.add('update xmzaiyan set zzjf='+strtocurr(edit_zzje.Text)+'where xmlxbh='''+edit_xmpzh.Text+'''');这一句出现
错误提示:incompatible typeds:"string" and "currency"
请问各位高手应该如何改?

解决方案 »

  1.   

    好象这样写查询语句是错的,我想是不是这样写的:
    with adoquery_jtxmdjb do
       begin
        close;
        sql.clear;
        parameters.clear;
        sql.add('update xmzaiyan set zzjf=:p1 where xmlxbh=:p2');
        parameters.parambyname('p1').value := strtocurr(edit_zzje.Text);
        parameters.parambyname('p2').value := edit_xmpzh.Text;
        ExecSQL;
       end;至于你说的incompatible typeds:"string" and "currency"
    可能应该用 "strtofloat(String)"这个函数
      

  2.   

    Sorry,好象是:sql.parameters,我不太记得了,好久没用了:-)
    你看一下delphi的智能提示就行了
      

  3.   


    直接
      sql.add('update xmzaiyan set zzjf='''+edit_zzje.Text+''' where xmlxbh='''+edit_xmpzh.Text+'''');
    试试