Name
Recordset.Index Property — (Versions 2.1, 2.5, 2.6)
Synopsis
recordset.Index = index
The Index property sets the current index for a given recordset.
Datatype
String
Description
The Index property is both read- and write-enabled. However, it cannot be set within a WillRecordsetChange or RecordsetChangeComplete event or during an asynchronous execution.
The Index property is used in conjunction with the Seek method to take advantage of the underlying table’s indexed structure (as compared to the Find method, which operates sequentially).
The position of the record pointer may change when the Index is set (changing the AbsolutePosition property value). In addition, the following events occur: WillRecordsetChange, RecordsetChangeComplete, WillMove, and MoveComplete.
If the LockType property is set to
adLockPessimistic or
adLockOptimistic, then the UpdateBatch method is
called releasing any filter that may be applied. In addition, the
record pointer is moved to the first record in the indexed recordset.
Note
Not all providers support indexes; therefore, they do not all support the Index property.
See Also
CursorOptionEnum Enumeration, Recordset.MoveComplete Event, Recordset.RecordsetChangeComplete Event, Recordset.Seek Method, Recordset.UpdateBatch Method, Recordset.WillMove Event, Recordset.WillRecordsetChange Event, Recordset.Supports Method
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access