Click or drag to resize

DbFileSpec.Move Method (Usual, Usual, Usual)

X#
Moves and/or renames all files associated with DBFileSpec objects to a different drive and/or directory. Updates DBFileSpec and/or OrderSpec instance variables. Will also rename auto-open index files. Only DBF, MEMO and auto-open index files will get renamed.

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

Parameters

oDBFSTarget (Optional)
Type: Usual
The drive and directory to move SELF's files into. Can also be an existing DBFileSpec object.
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 move. The default is FALSE.

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Examples
X#
 1// Move the CUSTOMER.DBF file to C:\TEST directory:
 2SetDefault("C:\CAVO25\SAMPLES\GSTUTOR")
 3oDB := DBFileSpec{ }
 4oDB:FileName := "customer"
 5IF oDB:Find()
 6oDB:Move("C:\TEST\")
 7ENDIF
 8// Move using FileSpec object
 9// Move the CUSTOMER.DBF file to C:\TEST directory:
10SetDefault("C:\CAVO25\SAMPLES\GSTUTOR")
11oFS := FileSpec{"C:\TEST\"}
12oDB := DBFileSpec{ }
13oDB:FileName := "customer"
14IF oDB:Find()
15oDB:Move(oFS)
16ENDIF
17// Move the CUSTOMER.DBF file to C:\TEST directory and rename:
18SetDefault("C:\CAVO25\SAMPLES\GSTUTOR")
19oDB := DBFileSpec{ }
20oDB:FileName := "customer"
21IF oDB:Find()
22oDB:Move("C:\TEST\NewFile")
23ENDIF
See Also