主题:大家帮我看看有什么语法错误?
看了很久了,就是找不出来啊
with frm_dm.temp do
begin
sql.clear;
if frm_ruxue.flagadd1=true then//添加状态
begin
sql.Add('insert into fresh_info(zkzh,km1,km2,km3,km4,zf,rxsj,xslb,zzmm)values(:zkzh,:km1,:km2,:km3,:km4,:zf,:rxsj,:xslb,:zzmm)' );
[color=FF0000]sql.Add(' where xh=:xh');[/color]错误在这附近
end
else sql.Add('update fresh_info set zkzh=:zkzh,km1=:km1,km2=:km2,km3=:km3,km4=:km4,zf=:zf,rxsj=:rxsj,xslb=:xslb,zzmm=:zzmm where xh=:xh');
parameters.ParamByName('xh').Value:=rzedit1.Text;
parameters.ParamByName('zkzh').Value:=rzedit8.Text;
parameters.ParamByName('km1').Value:=strtoint(rzedit3.Text);
parameters.ParamByName('km2').Value:=strtoint(rzedit4.Text);
parameters.ParamByName('km3').Value:=strtoint(rzedit5.Text);
parameters.ParamByName('km4').Value:=strtoint(rzedit6.Text);
parameters.ParamByName('zf').Value:=strtoint(rzedit7.Text);
parameters.ParamByName('rxsj').Value:=datetimepicker1.DateTime;
parameters.ParamByName('xslb').Value:=rzcombobox1.Text;
parameters.ParamByName('zzmm').Value:=rzcombobox2.Text;
execsql;
if frm_ruxue.flagadd1=true then showmessage('添加成功!')
else showmessage('修改成功!');
end;
with frm_dm.temp do
begin
sql.clear;
if frm_ruxue.flagadd1=true then//添加状态
begin
sql.Add('insert into fresh_info(zkzh,km1,km2,km3,km4,zf,rxsj,xslb,zzmm)values(:zkzh,:km1,:km2,:km3,:km4,:zf,:rxsj,:xslb,:zzmm)' );
[color=FF0000]sql.Add(' where xh=:xh');[/color]错误在这附近
end
else sql.Add('update fresh_info set zkzh=:zkzh,km1=:km1,km2=:km2,km3=:km3,km4=:km4,zf=:zf,rxsj=:rxsj,xslb=:xslb,zzmm=:zzmm where xh=:xh');
parameters.ParamByName('xh').Value:=rzedit1.Text;
parameters.ParamByName('zkzh').Value:=rzedit8.Text;
parameters.ParamByName('km1').Value:=strtoint(rzedit3.Text);
parameters.ParamByName('km2').Value:=strtoint(rzedit4.Text);
parameters.ParamByName('km3').Value:=strtoint(rzedit5.Text);
parameters.ParamByName('km4').Value:=strtoint(rzedit6.Text);
parameters.ParamByName('zf').Value:=strtoint(rzedit7.Text);
parameters.ParamByName('rxsj').Value:=datetimepicker1.DateTime;
parameters.ParamByName('xslb').Value:=rzcombobox1.Text;
parameters.ParamByName('zzmm').Value:=rzcombobox2.Text;
execsql;
if frm_ruxue.flagadd1=true then showmessage('添加成功!')
else showmessage('修改成功!');
end;