用CLOSE试试procedure TForm1.ADOTable1BeforeDelete(DataSet: TDataSet); begin with ADOTable1 do if Application.MessageBox('确实要删除吗?','删除',Mb_YESNO+Mb_IconStop) = IDYes then Delete else close; end;
procedure TForm1.ADOTable1BeforeDelete(DataSet: TDataSet); begin if Application.MessageBox('确实要删除吗?','删除',Mb_YESNO+Mb_IconStop) <> IDYes then abort; end;
begin
with ADOTable1 do
if Application.MessageBox('确实要删除吗?','删除',Mb_YESNO+Mb_IconStop) = IDYes then
Delete
else
close;
end;
begin
if Application.MessageBox('确实要删除吗?','删除',Mb_YESNO+Mb_IconStop) <> IDYes then
abort;
end;