Index Support and Find, Sort, and Filter

Microsoft ActiveX Data Objects (ADO)

Index Support and Find, Sort, and Filter

Indexes on fields can greatly enhance the performance of the Recordset object's Find method, and Sort and Filter properties. You can create an internal index for a Field object by setting its dynamic Optimize property. This dynamic property is added to the Field object's Properties collection when you set the CursorLocation property to adUseClient. Remember that this index is internal to ADO—you can't gain access to it or use it for any other purpose. Also, this index is distinct from the Recordset object's Index property.

The Sort property determines the order in which rows of a Recordset are traversed; the Filter property determines which rows are accessible when traversing rows; and the Find method quickly locates a value within a column (field) of a Recordset. You can often improve the speed of the Find method's operation on a column by using the Optimize property to create an index on it.