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:  XSharp.VO.SDK
Assembly:  XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD Copy(
	oDBFSTarget AS USUAL,
	 lIDX AS USUAL,
	 lName AS USUAL
) AS LOGIC
Request Example View Source

Parameters

oDBFSTarget
Type: Usual
The DBFileSpec object's target directory. Can be either optional or full path.
lIDX
Type: Usual
Logical parameter. TRUE also moves any index files associated with SELF. The default is TRUE.
lName
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: Logic
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