Creating a batch move component

To create a batch move component:

1 Place a table or query component for the dataset from which you want to import records (called the Source dataset) on a form or in a data module.

2 Place the dataset to which to move records (called the Destination dataset) on the form or data module.

3 Place a TBatchMove component from the BDE page of the Component palette in the data module or form, and set its Name property to a unique value appropriate to your application.

4 Set the Source property of the batch move component to the name of the table from which to copy, append, or update records. You can select tables from the dropdown list of available dataset components.

5 Set the Destination property to the dataset to create, append to, or update. You can select a destination table from the drop-down list of available dataset components.

  • If you are appending, updating, or deleting, Destination must represent an existing database table.
  • If you are copying a table and Destination represents an existing table, executing the batch move overwrites all of the current data in the destination table.
  • If you are creating an entirely new table by copying an existing table, the resulting table has the name specified in the Name property of the table component to which you are copying. The resulting table type will be of a structure appropriate to the server specified by the DatabaseName property.

6 Set the Mode property to indicate the type of operation to perform. Valid operations are batAppend (the default), batUpdate, batAppendUpdate, batCopy, and batDelete. For information about these modes, see "Specifying a batch move mode" on page 20-49.

7 Optionally set the Transliterate property. If Transliterate is True (the default), character data is translated from the Source dataset's character set to the Destination dataset's character set as necessary.

8 Optionally set column mappings using the Mappings property. You need not set this property if you want batch move to match columns based on their position in the source and destination tables. For more information about mapping columns, see "Mapping data types" on page 20-50.

9 Optionally specify the ChangedTableName, KeyViolTableName, and ProblemTableName properties. Batch move stores problem records it encounters during the batch operation in the table specified by ProblemTableName. If you are updating a Paradox table through a batch move, key violations can be reported in the table you specify in KeyViolTableName. ChangedTableName lists all records that changed in the destination table as a result of the batch move operation. If you do not specify these properties, these error tables are not created or used. For more information about handling batch move errors, see "Handling batch move errors" on page 20-51.

+2 0

Post a comment