Click or drag to resize

DbFileSpec.Rename Method (Usual, Usual)

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

Parameters

oDBFSNewName
Type: Usual
The new name for the DBF file.
lName
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: Logic
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