FireDAC.Comp.DataSet.TFDDataSet.CloneCursor
Delphi
procedure CloneCursor(ASource: TFDDataSet; AReset: Boolean = False; AKeepSettings: Boolean = False); virtual;
C++
virtual void __fastcall CloneCursor(TFDDataSet* ASource, bool AReset = false, bool AKeepSettings = false);
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
procedure function |
public | FireDAC.Comp.DataSet.pas FireDAC.Comp.DataSet.hpp |
FireDAC.Comp.DataSet | TFDDataSet |
Description
Shares the data belonging to another dataset.
Use CloneCursor to share the data belonging to another dataset with this dataset. After calling CloneCursor, the internal data storage is physically the same for this dataset and for the ASource dataset.
ASource is the reference to a dataset whose data will be shared with this dataset.
AReset and AKeepSettings determine how to set the values of the following properties and events:
- Filter, Filtered, FilterOptions, OnFilterRecord, and FilterChanges.
- IndexName, IndexFieldNames.
- MasterSource and MasterFields.
- ReadOnly.
If AReset and AKeepSettings are both False, the values of the properties listed above are all set to match the source dataset.
If AReset is True, the properties listed above are all set to the default values.
If AReset is False and AKeepSettings is True, the properties listed above are not changed. In this case, the application must ensure that existing indexes, filters, and so on are compatible with the cloned data.
CloneCursor does not clone:
- Persistent fields.
- Adapter / update object.
- Event handlers, excluding OnFilterRecord.
Example
FDMemTable1.CloneCursor(FDQuery1, True, False);
FDMemTable1.Locate(...);
FDMemTable1.Edit;
...