Adoquery1.post时用如下:
if editdbedit1.text='' then
begin
application.messagebox(char('XX不能为空!'),'提示信息',48);
editdbedit1.setfoucs;
end
else
try
adoquery1.post;
except
application.messagebox(char('保存出错'),'错误信息',16);
end;
以下仅供参考:
procedure TDataModule1.ADOT_StuBeforeDelete(DataSet: TDataSet);
var
DelStr1:string;
begin
DelStr1 := '确实要删除此记录吗?';
if MessageBox(Application.Handle,PChar(DelStr1),'警告',MB_YESNO or MB_ICONWARNING) = IDNO then Abort;
end;