天
天地弦
Unregistered / Unconfirmed
GUEST, unregistred user!
第二部分应该是善好的的Reconcile函数。
function TCustomClientDataSet.Reconcile(const Results: OleVariant): Boolean;
var
RCB: Pointer;
I: Integer;
AField: TField;
begin
B01 if VarIsNull(Results) then
MergeChangeLog else
B02 begin
B03 UpdateCursorPos;
B04 RCB := @TCustomClientDataSet.ReconcileCallback;
B05 FReconcileDataSet := TCustomClientDataSet.Create(Self);
B06 try
B07 Check(FDSBase.Clone(0, True, False, FReconcileDataSet.FDSBase));
B08 FReconcileDataSet.ObjectView := True;
B09 FReconcileDataSet.Open;
B10 for I := 0 to FReconcileDataSet.FieldCount - 1do
B11 begin
B12 AField := Self.FindField(FReconcileDataSet.Fields.FieldName);
B13 if Assigned(AField) then
B14 FReconcileDataSet.Fields.DisplayLabel := AField.DisplayLabel;
B15 end;
B16 Check(FDSBase.Reconcile_MD(FReconcileDataSet.FDSBase, FDeltaPacket,
B17 VarToDataPacket(Results), Integer(Self), RCB));
B18 finally
B19 FReconcileDataSet.Free;
B20 FReconcileDataSet := nil;
B21 end;
B22 Resync([]);
B23 end;
B24 Result := (ChangeCount = 0);
end;
function TCustomClientDataSet.Reconcile(const Results: OleVariant): Boolean;
var
RCB: Pointer;
I: Integer;
AField: TField;
begin
B01 if VarIsNull(Results) then
MergeChangeLog else
B02 begin
B03 UpdateCursorPos;
B04 RCB := @TCustomClientDataSet.ReconcileCallback;
B05 FReconcileDataSet := TCustomClientDataSet.Create(Self);
B06 try
B07 Check(FDSBase.Clone(0, True, False, FReconcileDataSet.FDSBase));
B08 FReconcileDataSet.ObjectView := True;
B09 FReconcileDataSet.Open;
B10 for I := 0 to FReconcileDataSet.FieldCount - 1do
B11 begin
B12 AField := Self.FindField(FReconcileDataSet.Fields.FieldName);
B13 if Assigned(AField) then
B14 FReconcileDataSet.Fields.DisplayLabel := AField.DisplayLabel;
B15 end;
B16 Check(FDSBase.Reconcile_MD(FReconcileDataSet.FDSBase, FDeltaPacket,
B17 VarToDataPacket(Results), Integer(Self), RCB));
B18 finally
B19 FReconcileDataSet.Free;
B20 FReconcileDataSet := nil;
B21 end;
B22 Resync([]);
B23 end;
B24 Result := (ChangeCount = 0);
end;