begin
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('update jfb set 会员编号=:a,会员积分 =会员积分+ :b where 会员编号=:a ');
Parameters.ParamByName('a').Value:=trim(edit1.Text);
Parameters.ParamByName('b').Value:=strtoint(edit2.Text);
execsql;
end; 这样做不对啊,总报错.请高手指点应该如何写呢
将sql.Add('update jfb set 会员编号=:a,会员积分 =会员积分+ :b where 会员编号=:a ');修改一下sql.Add('update jfb set 会员积分 =会员积分+ :b where 会员编号=:a ');否则没法将数据更新进去。
按你上面原先写的报错应该不会,除非你会员积分的类型定义为非数值型。