代码如下:procedure Tplanfrm.Button8Click(Sender: TObject); var x:string; y:string; begin if application.MessageBox('删除全部信息?','提示',MB_OKcancel+MB_iconinformation)=IDOK then begin x:=A1.SQL.GetText; y:=StringReplace(x,'select','delete',[rfReplaceAll]); if A1.Active then A1.Active:=false; A1.SQL.Clear; A1.SQL.Add(y); A1.ExecSQL; if A1.Active then A1.Active:=false; A1.SQL.Clear; a1.SQL.Add('select * from plan'); a1.Active:=true; end else abort; end;目的是将A1查询到的结果全部删除,可是有时候单击BUTTON1时好像没反应,再点击一次又能正确执行了。。DELPHI没有报错信息。。
var
x:string;
y:string;
begin
if application.MessageBox('删除全部信息?','提示',MB_OKcancel+MB_iconinformation)=IDOK then
begin
x:=A1.SQL.GetText;
y:=StringReplace(x,'select','delete',[rfReplaceAll]);
if A1.Active then A1.Active:=false;
A1.SQL.Clear;
A1.SQL.Add(y);
A1.ExecSQL;
if A1.Active then A1.Active:=false;
A1.SQL.Clear;
a1.SQL.Add('select * from plan');
a1.Active:=true;
end
else abort;
end;目的是将A1查询到的结果全部删除,可是有时候单击BUTTON1时好像没反应,再点击一次又能正确执行了。。DELPHI没有报错信息。。