PROPERTY:

 

 

 

 

 

 

 

DESCRIPTION:

 

 

Indicates one or more field names on which the rows is sorted and whether each field is sorted in ascending or descending order.

 

 

 

 

PROPERTY OF:

 

 

ADORowset

 

 

 

 

DEFAULT VALUE:

 

 

Empty string 

 

 

 

 

 

DESCRIPTION:

 

 

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.

 

 

 

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.

 

 

 

When the value of the sort property is anything other than an empty string, the sort property order takes precedence over 

 

the order specified in an "ORDER BY" clause included in the SQL statement used to open data source.

 

 

 

Setting the sort property to an empty string will reset the rows to their original order and delete temporary indexes. 

 

Existing indexes will not be deleted.

 

 

 

For example, rowset contains three fields named "firstName","lastName" and "Age". 

 

Set the sort property to the string : "lastName DESC, firstName ASC", which will order the rowset by "lastName" in descending order,

 

then by "firstName" in ascending order. The "Age" is ignored.

 

 

 

No field can be named "ASC" or "DESC" because those names conflict with the keywords ASC and DESC. 

 

Give a field with a conflicting name an alias by using the "AS" keyword in the query that returns the rowset.

 

 

 

This property requires the cursorLocation property to be set to client-side.