Navigation:  Classes > bArrayServer >

bArrayServer:CopyDB()

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

Copy records into a DBF file.

Class

bArrayServer

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

lSuccessA logical value indicates whether the records could be copied into the DBF file.
TRUEThe records were copied.
FALSEThe 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

bArrayServer:CopyDelimited()

bArrayServer:CopySDF()

bArrayServer:CopyStructure()

bArrayServer:CopyToFile()

 


Page url: http://www.YOURSERVER.com/index.html?barrayserver_copydb.htm