语句如下:
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"
请问各位高手应该如何改?
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"
请问各位高手应该如何改?
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)"这个函数
你看一下delphi的智能提示就行了
直接
sql.add('update xmzaiyan set zzjf='''+edit_zzje.Text+''' where xmlxbh='''+edit_xmpzh.Text+'''');
试试