Click or drag to resize

DbServer.SetIndex Method

Open an index file and select its order as the controlling order, if this is the first index being opened.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.5
Syntax
 VIRTUAL METHOD SetIndex(
	oFSIndexFile AS USUAL
) AS USUAL

Parameters

oFSIndexFile
Type: Usual
The index file can be specified as a FileSpec object or as a file name in string format, with or without file type.  File type defaults to the native type for the driver (RDD). If no argument is passed, all currently opened indexes are closed, and the server reverts back to sequential access based on record number (natural order).  This is equivalent to ClearIndex().

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Remarks
Sends a NotifyIntentToMove message before the operation.  Sends a NotifyFileChange message, if successful. If the index file contains more than one order, the first one is set as the controlling order.  The server is positioned to the first logical record in the controlling order.
Examples
The following example opens multiple index files:
X#
1oSales := DBServer{"sales"}
2oSales:SetIndex("firstname")
3oSales:SetIndex("lastname")
4IF oSales:Seek(cLast)
5IF oSales:Deleted() .AND. RLock()
6oSales:Recall()
7ENDIF
8ENDIF
See Also