16,747
社区成员




procedure TForm.btnClick(Sender: TObject);
begin
inherited;
if Application.MessageBox(PChar(' xxxx '),'',MB_YESNO) = IDYES then
begin
qry.Close;
qry.SQL.Text:= 'xxx';
qry.ExecSQL;
end;
end;
qry.Close;//此处不报错
qry.SQL.Text:= 'xxx';
qry.ExecSQL;
if Application.MessageBox('xxx','',MB_YESNO) = IDYES then
begin
qry.Close;//此处报错
qry.SQL.Text:= 'xxx';
qry.ExecSQL;
end;
这两个代码是相连的?还是不是完整代码?