CopyRecord()


Copies a record from one database to another.

Syntax

CopyRecord(<cSource>, <cTarget>) --> lSuccess

Arguments

<cSource> --> The name of the database to copy from.

<cTarget> --> The name of the destination database to copy to.

Returns

Returns a logical value of TRUE if the record was successfully copied from the source database to the target database.

Description

The CopyRecord() function is used to copy the fields of the currently selected record in the source database to a new record in the target database. A new record is appended to the end of the target database to accommodate the new record.

For a record copy to be successful at least one field from the source database must match a field from the target database. If there are no matching fields a copy does not take place.

Fields do not have to be of the same type. Only the field names need match. So a field with the name "Money" of character type can be copied to a field "Money" of numeric type in the target database.

Information may be lost or converted to a different format if the fields in both the source and target databases do not have identical sizes and types. Copying to a target field that is smaller than the source field, for example, will lead to some information being truncated.

CAPITAL retains the current record positions of both databases after the record is copied.

Both records must be open before CopyRecord() may be called.

generate/mistake2.gifDo not use this function to copy records in standard CAPITAL databases. Standard databases expect default values to be assigned to newly created records. The CopyRecord() function does not assign these default values.

____________________________

Related Topics:

Business Function List



CAPITAL VISUAL BUILDER