brIndexKey property

Returns the actual string found by the last index operation.

Syntax

sValue = object.brIndexKey

Parameters

Parameter Description
sValue The return value is a String data type.
object An object variable that represents a clsD3Index object.

Remarks

Before an index operation, this property returns the search string that is used by the next index operation. Following an index operation, this property returns the actual string found.

Example

Sub Main()
   Dim oEnv As New clsD3Environment
   Dim oConn As clsD3Connection
   Dim oFile As clsD3File
   Dim oIndex As clsD3Index
 
   Set oConn = oEnv.brOpenConnection("ODBC", "Production") 
   Set oFile = oConn.brOpenFile("customers")
 
   On Error GoTo D3ErrorHandler
 
   ' If there is not an existing index on attribute 1,
   ' then the D3ErrorHandler will create an index.
   Set oIndex = oFile.brRoot("a1")
 
   ' brMoveNext is the first index function to
   ' be performed so the index will be traversed
   ' from the beginning.
   Do While oIndex.brMoveNext
      ' brIndexId returns the item-ids from the
      ' customers file that is the customerid.
      ' brIndexKey returns the customer's name (attribute1).
      Debug.Print oIndex.brIndexId, oIndex.brIndexKey
   Loop
 
   oConn.brCloseFile oFile
   oEnv.brCloseConnection oConn
   Set oEnv = Nothing
Exit Sub
 
D3ErrorHandler:
   Select Case Err.Number
      Case d3SrvErr_NotRoot
         oFile.brCreateIndex "a1", True
      Case Else
         End
 
   End Select
   Resume
End Sub

FlashBASIC reference

key - index.key variable

Applies to

clsD3Index class