sql 添加问题 请帮帮忙.(100分)

  • 主题发起人 主题发起人 nydelphi
  • 开始时间 开始时间
N

nydelphi

Unregistered / Unconfirmed
GUEST, unregistred user!
var<br>&nbsp; str1,str2,str3:string;<br>&nbsp; str4:Currency;<br>&nbsp; str5:integer;<br>begin<br>&nbsp; str1:=ADOQuery1MenuName.AsString;<br>&nbsp; str2:=ADOQuery1MenuUnit.AsString; &nbsp;<br>&nbsp; str3:=ADOQuery1MenuType.AsString;<br>&nbsp; str4:=ADOQuery1MenuPrice.AsCurrency;<br>&nbsp; no:=10000;<br>&nbsp; with adoquery2 do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; close;<br>&nbsp; &nbsp; sql.Clear;<br>&nbsp; &nbsp; sql.Text:='INSERT INTO jiezhang (memuname,memuclass,memutype,menuprice) VALUES('''+str1+''','''+str2+''',,'''+str3+''','''+str4+''')';<br>&nbsp; &nbsp; ExecSQL;<br><br><br>编译时 为什么还是说incompatible types:'string' and 'currency' &nbsp;<br><br>数据库中memupric为货币类型
 
str4:string;<br>-----<br>str4:=adoquery1MenuPrice.asString;<br>-----<br>sql.Text:='INSERT INTO jiezhang (memuname,memuclass,memutype,menuprice) VALUES('''+str1+''','''+str2+''',,'''+str3+''','+str4+')';
 
...添加出现insert into 语法错误 闷啦
 
问题解决 谢谢啦
 
后退
顶部