Purpose
Copy records into a DBF file.
Class
Type
Method
Syntax
<oArrayServer>:CopyDB(
<oDBFTarget> | <oFSTarget> | <cTarget>,
[<aiField> | <acField> | <asymField> | <aoDFField>],
[<uForCondition>],
[<uWhileCondition>],
[<uScope>],
[<cDriver>],
[<acRDD>]
) Æ lSuccess
Arguments
<oDBFTarget> | An object of class DBServer. The records are copied into the DBServer. The DBServer must be open. |
Data Type: | DBServer |
<oFSTarget> | A file path as FileSpec. The DBF file is created with this path. An existing file is overwritten. |
Data Type: | FileSpec |
<cTarget> | A file path as string. The DBF file is created with this path. An existing file is overwritten. |
Data Type: | String |
<aiField> | An array of field numbers. The values of these fields are copied into the DBF file. If omitted, all fields of the ArrayServer are used as default. |
Data Type: | Array |
<acField> | An array of field names as string. The values of these fields are copied into the DBF file. If omitted, all fields of the ArrayServer are used as default. |
Data Type: | Array |
<asymField> | An array of field names as symbol. The values of these fields are copied into the DBF file. If omitted, all fields of the ArrayServer are used as default. |
Data Type: | Array |
<aoDFField> | An array of DataField objects. The values of these fields are copied into the DBF file. If omitted, all fields of the ArrayServer are used as default. |
Data Type: | Array |
<uForCondition> | A condition evaluated for each record in the scope. Only records for which evaluation of the condition returns the result of TRUE are copied into the DBF file. |
Data Type: | String | Codeblock | _Codeblock |
<uWhileCondition> | A condition evaluated for each record from the current record until the condition returns FALSE. |
Data Type: | String | Codeblock | _Codeblock |
<uScope> | Define the range of records to process. The values below are supported: |
Value |
Description |
DBSCOPEALL |
The scope is all the records in the bArrayServer. This is the default. |
DBSCOPEREST |
The scope is the remaining records in the bArrayServer from the current position. |
<iRecords> |
The scope is the next <iRecords> records. |
Data Type: | Logic | Integer |
<cDriver> | The name of the RDD which is used for the DBF file. If not specified, the default RDD as determined by RDDSetDefault() is used. |
Data Type: | String |
<acRDD> | An array with the names of RDD which are used for the DBF file in addition to the main RDD. If omitted, no additional RDD are used. |
Data Type: | Array |
Return Value
lSuccess | A logical value indicates whether the records could be copied into the DBF file. |
TRUE | The records were copied. |
FALSE | The records could not be copied. |
Data Type: | Logic |
Description
bArrayServer:CopyDB() copies all or single records from the ArrayServer into a DBF file. If the DBF file already exists, then it is overwritten. The directory path for the file must already exist. It is not created automatically.
If argument 2 is not supplied then all fields of the ArrayServer are copied into the DBF file.
When creating the DBF only fields which are of the data type "C", "D", "L", "M" or "N" are used. Fields of other data types are ignored. Furthermore the field names are adapted to the format of DBF field names. None alpha numeric characters in the field names are replaced by the character "_". Long field names be cut of on 10 characters. If duplicate field names arise then the field name is cut to 7 characters and an ascending serial number is added.
Note!
After copying the record pointer is unchanged.
See Also
Page url: http://www.YOURSERVER.com/index.html?barrayserver_copydb.htm