本例是在窗體關閉前判斷是否有未保存的數據
procedure TFrmSave
begin
if ADODataSet
begin
if MessageBox(
MB_ICONQUESTION) = IDYES then
begin
SaveData;
end;
end;
end;
{保存數據}
procedure TFrmSave
begin
with ADODataSet
begin
Edit;
FieldByName(
FieldByName(
FieldByName(
if CBxSex
FieldByName(
else
FieldByName(
FieldByName(
FieldByName(
FieldByName(
Post;
end;
end;
From:http://tw.wingwit.com/Article/program/Delphi/201311/24857.html