procedure TForm1.Button5Click(Sender: TObject);
begin
adoquery1.close;
adoquery1.sql.clear;
adoquery1.add('select * from table where .....');
adoquery1.open;                                   
 if adoquery1.RecordCount=0 then                   
  MessageBox(0,'SetCommMask Error !','Notice',MB_OK)
 else
if Application.MessageBox('是否删除当前记录?','提示',mb_yesno)=id_yes then
begin
 ADOQuery1.close;
 ADOQuery1.sql.clear;
 ADOQuery1.sql.add('delete table where ....');
 ADOQuery1.execsql;
end;
end;