表中的字段为以下提到的字段,
字符串字段可以为空,数字型字段默认为0。表中没主键。出现问题是:
总现在“语法错误(操作符丢失)在表达式中“某某中””的错误提示,
其中“某某”有时指日期字段,有时指“备注”字段。等等。大家看看能找出什么问题??procedure TForm4.BitBtn4Click(Sender: TObject);
var fil:string;
begin
if MessageDlg('删除此条记录?',mtConfirmation,[mbYes,mbNo],0)=mrNo then
exit;fil:='';if trim(dbedit12.Text)<>'' then
fil:='类型='+quotedstr(dbedit12.text);if trim(dbedit13.Text)<>'' then
if fil='' then
fil:='名称='+quotedstr(dbedit13.text)
else
fil:=' and 名称='+quotedstr(dbedit13.text);if trim(dbedit14.Text)<>'' then
if fil='' then
fil:='规格='+quotedstr(dbedit14.text)
else
fil:=' and 规格='+quotedstr(dbedit14.text);if trim(dbedit15.Text)<>'' then
if fil='' then
fil:='品牌='+quotedstr(dbedit15.text)
else
fil:=' and 品牌='+quotedstr(dbedit15.text);if trim(dbedit16.Text)<>'' then
if fil='' then
fil:='车型='+quotedstr(dbedit16.text)
else
fil:=' and 车型='+quotedstr(dbedit16.text);if trim(dbedit17.Text)<>'' then
if fil='' then
fil:='通用车型='+quotedstr(dbedit17.text)
else
fil:=' and 通用车型='+quotedstr(dbedit17.text);if trim(dbedit18.Text)<>'' then
if fil='' then
fil:='销售='+quotedstr(dbedit18.text)
else
fil:=' and 销售='+quotedstr(dbedit18.text);if trim(dbedit27.Text)<>'' then
if fil='' then
fil:='单位='+quotedstr(dbedit27.text)
else
fil:=' and 单位='+quotedstr(dbedit27.text);if trim(dbedit19.Text)<>'' then
if fil='' then
fil:='单价='+dbedit19.text
else
fil:=' and 单价='+dbedit19.text;if trim(dbedit20.Text)<>'' then
if fil='' then
fil:='数量='+dbedit20.text
else
fil:=' and 数量='+dbedit20.text;if trim(dbedit21.Text)<>'' then
if fil='' then
fil:='总额='+dbedit21.text
else
fil:=' and 总额='+dbedit21.text;if trim(dbedit22.Text)<>'' then
if fil='' then
fil:='客户='+quotedstr(dbedit22.text)
else
fil:=' and 客户='+quotedstr(dbedit22.text);if trim(dbedit23.Text)<>'' then
if fil='' then
fil:='维修费='+dbedit23.text
else
fil:=' and 维修费='+dbedit23.text;if trim(dbedit28.Text)<>'' then
if fil='' then
fil:='结帐='+quotedstr(dbedit28.text)
else
fil:=' and 结帐='+quotedstr(dbedit28.text);if trim(dbedit24.Text)<>'' then
if fil='' then
fil:='日期=#'+dbedit24.text+'#'
else
fil:=' and 日期=#'+dbedit24.text+'#';if trim(dbedit25.Text)<>'' then
if fil='' then
fil:='备注='+quotedstr(dbedit25.text)
else
fil:=' and 备注='+quotedstr(dbedit25.text);if fil<>'' then
begin
with adoquery3 do
begin
try
close;
sql.clear;
sql.Add('delete from 出货 where '+fil);
execsql;
except
raise;//错误提示
end;
end;
end;end;