Click or drag to resize

DbFileSpec.Copy Method (Usual, Usual, Usual)

X#
Copies all files associated with DBFileSpec objects to a different drive and/or directory.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD Copy(
	oDBFSTarget,
	lIDX,
	lName
) AS USUAL CLIPPER
Request Example View Source

Parameters

oDBFSTarget (Optional)
Type: Usual
The DBFileSpec object's target directory. Can be either optional or full path.
lIDX (Optional)
Type: Usual
Logical parameter. TRUE also moves any index files associated with SELF. The default is TRUE.
lName (Optional)
Type: Usual
Logical parameter. TRUE causes an auto-rename of the target file if a file conflict occurs during the copy. The default is FALSE.

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Examples
X#
 1// Copy the CUSTOMER.DBF file to C:\TEST directory:
 2SetDefault( "C:\CAVOxx\SAMPLES\GSTUTOR" )
 3oDB := DBFileSpec{}
 4oDB:FileName := "CUSTOMER"
 5IF oDB:Find()
 6oDB:Copy( "C:\TEST\" )
 7ENDIF
 8// Copy using FileSpec object
 9// Copy CUSTOMER.DBF file to C:\TEST\COPY\DBFS directory:
10// Copy the TEST.DBF file to C:\TEST directory:
11SetDefault( "C:\CAVOxx\SAMPLES\GSTUTOR" )
12oFS := FileSpec{ "C:\TEST\" }
13oDB := DBFileSpec{}
14oDB:FileName := "CUSTOMER"
15IF oDB:Find()
16oDB:Copy( oFS )
17ENDIF
See Also