轉貼自: http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=41577
BatchUpdate 模式下ADO資料集FilterGroup含有以下特性:fgUnassigned,fgNone,fgPendingRecords,fgAffectedRecords,fgFetchedRecords,fgPredicate,fgConflictingRecords.
fgPendingRecords : 只顯示被異動過但尚未被更新回資料來源的資料
或是被異動過但尚未被取消更新的資料.
例:
代碼: 選擇全部
procedure Tform1.RadioButton1Click(Sender: TObject);
begin
if (datamodule2.ADODataSet1.LockType = ltBatchOptimistic) then
begin
datamodule2.ADODataSet1.Filtered := true;
datamodule2.ADODataSet1.FilterGroup := fgPendingRecords;
end;
end;
end;