Y
YNTW
Unregistered / Unconfirmed
GUEST, unregistred user!
with ADOConnection1 do
try
Application.ProcessMessages;
Screen.Cursor:=crHourGlass;
BeginTrans;
with ADOQueryC1 do
begin
close;
sql.Text:='delete from XS where XH not like "'+Edit1.Text+'%"';
execsql;
close;
sql.Text:='delete from XSCJ where XH not like "'+Edit1.Text+'%"';
execsql;//在IDE环境中运行,出错时Delphi定位在这行
close;
sql.Text:='delete from BJ where BJH not like "'+Edit1.Text+'%"';
execsql;
close;
sql.Text:='delete from XX where XXH not like "'+Edit1.Text+'%"';
execsql;
close;
sql.Text:='delete from KC where XXBH not like "'+Edit1.Text+'%"';
execsql;
close;
sql.Text:='delete from PQ where PQ<>"'+Edit1.Text+'%"';
execsql;
close;
end;
CommitTrans;
Screen.Cursor:=crDefault;
Application.MessageBox('成功!','返回信息',MB_OK+MB_ICONInformation);
except
RollbackTrans;
Screen.Cursor:=crDefault;
Application.MessageBox('失败!','返回信息',MB_OK+MB_ICONError);
end;
try
Application.ProcessMessages;
Screen.Cursor:=crHourGlass;
BeginTrans;
with ADOQueryC1 do
begin
close;
sql.Text:='delete from XS where XH not like "'+Edit1.Text+'%"';
execsql;
close;
sql.Text:='delete from XSCJ where XH not like "'+Edit1.Text+'%"';
execsql;//在IDE环境中运行,出错时Delphi定位在这行
close;
sql.Text:='delete from BJ where BJH not like "'+Edit1.Text+'%"';
execsql;
close;
sql.Text:='delete from XX where XXH not like "'+Edit1.Text+'%"';
execsql;
close;
sql.Text:='delete from KC where XXBH not like "'+Edit1.Text+'%"';
execsql;
close;
sql.Text:='delete from PQ where PQ<>"'+Edit1.Text+'%"';
execsql;
close;
end;
CommitTrans;
Screen.Cursor:=crDefault;
Application.MessageBox('成功!','返回信息',MB_OK+MB_ICONInformation);
except
RollbackTrans;
Screen.Cursor:=crDefault;
Application.MessageBox('失败!','返回信息',MB_OK+MB_ICONError);
end;