TFDMemTable已修改的数据序列为流
uses FireDAC.Stan.Intf, FireDAC.Comp.Client; function fdmemtable2stream(fdmemtable: TFDMemTable): TStream; begin fdmemtable.CachedUpdates := True; Result := TMemoryStream.Create; if fdmemtable.State in dsEditModes then fdmemtable.Post; if fdmemtable.ChangeCount = 0 then Exit; fdmemtable.ResourceOptions.StoreItems := [siDelta, siMeta]; try fdmemtable.SaveToStream(Result, TFDStorageFormat.sfBinary); Result.Position := 0; finally fdmemtable.ResourceOptions.StoreItems := [siDelta, siMeta, siData]; end; end;