Click or drag to resize

DbFileSpec.Rename Method

X#
Renames files associated with DBFileSpec object. Only DBF/MEMO and auto-open index files will get renamed. Rename() will not rename a file if it is already open or there is a file name conflict. To rename files to another directory, use the Move() method and supply a different target file name.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD Rename(
	oDBFSNewName,
	lName
) AS USUAL CLIPPER
Request Example View Source

Parameters

oDBFSNewName (Optional)
Type: Usual
The new name for the DBF file.
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#
1SetDefault("C:\CAVO2x\SAMPLES\GSTUTOR")
2oDB := DBFileSpec{ }
3oDB:FileName := "customer"
4IF oDB:Find()
5IF !oDB:Rename("NewFile", TRUE )
6// Did not work, so let the user know…
7ENDIF
8ENDIF
See Also