TTdbBatchMove

Index
TurboDB Components
    TTdbDataSet
    TTdbTable
    TTdbBatchMove
Turbo Database
    Overview
    Colum Data Types
    Queries
    Operators and Functions
    Working with Indexes
    Automatic Linking
    Working with Link and Relation Fields
    Shared Tables
    Table Locks
    Data Security
TurboDB Tools
    TurboDB Workbench
    TurboDB Data Exchange
    dataWeb Builder
    Visua Data Publisher
Frequently Asked Questions

[prev][next]

This class is used for importing into and exporting from a TurboDB table. It is very similar to the TBatchMove component you know from the BDE components but uses a file rather than a table as the source/destination for import/export.

Properties

TTdbBatchMove.AppendedCount
Reports the number of records from the Source which were appended to the destination.
property AppendedCount: Longint;
Read AppendedCount to learn the number of records from the Source that were added to the Destination during the Execute method. This value does not include records that were excluded from the batch move due to the Filter condition.

TTdbBatchMove.ColumnNames
Indicates that a text file contains the table column names in the first record.
property ColumnNames: Boolean;
This property is only used if the batch move is an export to or an import from a text file. If Direction is set to bmdExport, the property tells the TTdbBatchMove component to write the names of the table fields as the first row in the export file. If Direction is set to bmdImport and ColumnNames is set to true, then the first row of the import file is interpreted as the list of column names.

TTdbBatchMove.Direction
Indicates the direction of the data transfer.
property Direction: TBatchMoveDirection
Set this property to switch between import and export of records.

TTdbBatchMove.FileName
Indicates the file name of the other data source.
property FileName: string;
Use file name to set the name of the external file for import or export. If the Direction is bmdImport, the file must exist and contain records in the format indicated by the FileType property. It the Direction is bmdExport, the file will be created by the Execute method. In this case an existing file with this name will be overwritten.

TTdbBatchMove.FileType
Indicates the file format of the destination/source data source for the batch move.
property FileType: TTableFormat;
Set this property to indicate the file type of the data source from which records will be imported or to set the desired file format for the export. Some file types only work in a certain Direction. If the file type and the direction don't match, Execute will raise an exception.

TTdbBatchMove.Filter
Defines a filter-condition for the records to be imported or exported.
property Filter: string;
Set Filter to restrict the set of records to be transferred. Filter is a search-condition as described in "Search-Conditions".

TTdbBatchMove.Mappings
Contains a list of column assignments for the import.
property Mappings: TStrings;
Set Mappings to specify the correspondence between fields in the Source and fields in the Destination. By default TBatchMove matches fields based on their position in the source and destination tables. That is, the first column in the source is matched with the first column in the destination, and so on. Mappings enables an application to override this default.
To map the column named SourceColName in the source table to the column named DestColName in the destination table, use:
DestColName=SourceColName
You may also use the column no proceeded by a $ for the mapping:
$8=$3
You can mix the column identifiers in a mapping as well:
$8=SourceColName
When adding or appending records, fields in Destination which have no entry in Mappings will be set to NULL. When copying a dataset, fields in Destination which have no entry in Mappings will not appear as columns in the copy of the table.
If source and destination column data types are not the same, TBatchMove can either cancel the batch operation or perform a "best fit". If AbortOnProblem is True, type mismatches will terminate the batch move. Otherwise, the field values from the Source will be converted, if possible, to be compatible with the Destination.

TTdbBatchMove.TdbTable
Indicates the TurboDB table component, that is the source or destination for export or import.
property TdbTable: TTdbTable;
Set TdbTable to the table component into which you want transfer records or from which you want to export records. If Direction is bmdImport, records will be transferee from the external data source FileName in to the table indicated by TdbTable. If Direction is bmdExport , the records will be written in the file from the table component.

Methods

TTdbBatchMove.Execute
Performs the batch operation specified by Direction.
procedure Execute;
After setting properties to indicate what batch operation should be performed and how, call Execute to perform the operation. As a minimum, the FileName, FileType and Direction properties must be set.

Events

TTdbBatchMove.OnProgress
Occurs after a portion of the batch move process is finished.
TBatchMoveProgress = procedure(Sender: TObject; PercentDone: Byte; var Stop: Boolean) of object; property OnProgress: TBatchMoveProgress;
Write an OnProgress event to show the progress of the batch move on screen. PercentDone contains the percentage of the records that has been imported/exported. By setting the Stop argument to True, you can also cancel the batch move.

[prev][next]

Last updated on 11/19/2000. Copyright (c) 2000 by dataWeb GmbH, Aicha, Germany. Turbo Database and TurboDB Components are products by dataWeb - the manufacturers of RAD tools for the Web. Please send your hints, questions and comments to Peter Pohmann.