AdoRecordSet:Sort

<< Click to Display Table of Contents >>

Navigation:  Ado Classes > AdoRecordset Class >

AdoRecordSet:Sort

Previous pageReturn to chapter overviewNext page

Purpose

One or more field names on which the Recordset is sorted, and whether each field is sorted in ascending or descending order

 

Prototype

PROPERTY Sort AS STRING 

 

Return

 

STRING        a String of field names in the Recordset to sort on

 

Description

 

Returns a String of field names in the Recordset to sort on. Each name is separated by a comma, and is optionally followed by a blank and the keyword, ASC, which sorts the field in ascending order, or DESC, which sorts the field in descending order. By default, if no keyword is specified, the field is sorted in ascending order

 

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.

 

See Also

AdoRecordSet, AdoRecordSet:Index