EasyTable: Single-File Embedded BDE Replacement
Database for Delphi and C++Builder
Adds records from any dataset.
function AddRecords(Dataset: TDataSet; Mode: TAddRecordsMode; var Log : string): Boolean;
Description
Transfers records from any source dataset to the destination currrent table. Fields in source and destination tables are mapped by names.
Dataset specifies the dataset that is the source of the transfer operation..
If a filter is currently in effect on Dataset, the filter conditions are respected when the transfer executes.
The Mode property indicates how the dataset records are applied to the current destination table:
Mode
|
Effect on destination
|
arAppend
|
Records are added to the destination table.
|
arUpdate
|
Records in the destination table with AutoInc field matching the corresponding field in the source are changed to match the source records.
|
arAppendUpdate
|
Records in the destination table with AutoInc field matching the corresponding field in the source are changed to match the source. Source records that do not match AutoInc field are added to the destination table.
|
arReplace
|
Records in the destination table are completely replaced by the source records.
|
Errors and warning messages are stored into the Log variable.
If the transfer process completed successfully, this function returns True. The Log parameter will be an empty string.This function returns False, indicating that some errors occured. The error and warning messages will be returned in the Log variable.
Note: This method could be used to synchronize two tables having the same or similar structure.
|