Click or drag to resize

DbFileSpec.CopyTo Method

X#
Copies the DBFileSpec object's DBF file to another data format. This can be used for copying out to another RDD, to a delimited file, or to an SDF file.
Copies the DBFileSpec object's DBF file to another data format. This can be used for copying out to another RDD, to a delimited file, or to an SDF file.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD CopyTo(
	oFS,
	cDriver,
	lWantAnsi
) AS USUAL CLIPPER
Request Example View Source

Parameters

oFS (Optional)
Type: Usual
The drive and directory into which to copy SELF's files. Can also be an existing DBFileSpec object or FileSpec object.The drive and directory into which to copy SELF's files. Can also be an existing DBFileSpec object or FileSpec object.
cDriver (Optional)
Type: Usual
The target file's RDD.The target file's RDD.
lWantAnsi (Optional)
Type: Usual
Logical parameter. TRUE creates the target file in ANSI format. The default is the source DBFileSpec's ANSI setting.Logical parameter. TRUE creates the target file in ANSI format. The default is the source DBFileSpec's ANSI setting.

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Examples
The following examples illustrate copying a DBF file to different data formats:
X#
 1// Export the records of CUSTOMER.DBF/DBT file to various formats:
 2SetDefault( "C:\CAVOxx\SAMPLES\SSATUTOR" )
 3oDB := DBFileSpec{}
 4oDB:FileName := "CUSTOMER"
 5IF oDB:Find()
 6// copy out to DBF/FPT
 7oDB:CopyTo( "cust_CDX", "DBFCDX" )
 8// copy out to a delimited file
 9oDB:Delim := ","
10oDB:CopyTo( "cust_DEL" )
11oDB:Delim := NULL_STRING
12// copy out to an SDF file
13oDB:SDF := TRUE
14oDB:CopyTo( "cust_SDF" )
15oDB:SDF := FALSE
16// copy out to a DBF/DBV file
17oDB:HidRDDs := { "DBFMEMO" }
18oDB:CopyTo( "cust_DBV" )
19oDB:HidRDDs := {}
20ENDIF
Examples
The following examples illustrate copying a DBF file to different data formats:
X#
 1// Export the records of CUSTOMER.DBF/DBT file to various formats:
 2SetDefault( "C:\CAVOxx\SAMPLES\SSATUTOR" )
 3oDB := DBFileSpec{}
 4oDB:FileName := "CUSTOMER"
 5IF oDB:Find()
 6// copy out to DBF/FPT
 7oDB:CopyTo( "cust_CDX", "DBFCDX" )
 8// copy out to a delimited file
 9oDB:Delim := ","
10oDB:CopyTo( "cust_DEL" )
11oDB:Delim := NULL_STRING
12// copy out to an SDF file
13oDB:SDF := TRUE
14oDB:CopyTo( "cust_SDF" )
15oDB:SDF := FALSE
16// copy out to a DBF/DBV file
17oDB:HidRDDs := { "DBFMEMO" }
18oDB:CopyTo( "cust_DBV" )
19oDB:HidRDDs := {}
20ENDIF
See Also