Description |
Sets or gets the Sort property of the wrapped ADODB.Recordset object. This property requires the CursorLocation property to be set to adUseClient. A temporary index will be created for each field specified in the Sort property if an index does not already exist. The sort operation is efficient because data is not physically rearranged, but is simply accessed in the order specified by the index. Setting the Sort property to an empty string will reset the rows to their original order and delete temporary indexes.
Suppose a Recordset contains three fields named firstName, middleInitial, and lastName. Set the Sort property to the string, "lastName DESC, firstName ASC", which will order the Recordset by last name in descending order, then by first name in ascending order.
|