随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253


TClientDataSet.UpdateStatus: TUpdateStatus;
TUpdateStatus = (usUnmodified, usModified, usInserted, usDeleted);

测试图:



相关代码:
uses TypInfo;

procedure TForm1.ClientDataSet1CalcFields(DataSet: TDataSet);
begin
  ClientDataSet1.FieldByName('UpdateStatus').AsString :=
    GetEnumName(TypeInfo(TUpdateStatus), Ord(ClientDataSet1.UpdateStatus));
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ClientDataSet1.MergeChangeLog;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ClientDataSet1.Delete;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  ClientDataSet1.UndoLastChange(True);
end;

posted on 2010-02-03 17:08  万一  阅读(...)  评论(...编辑  收藏