Sort Property (DAO)

Microsoft DAO 3.60

Sort Property

           

Sets or returns the sort order for records in a Recordset object (Microsoft Jet workspaces only).

Settings and Return Values

The setting or return value is a String that contains the ORDER BY clause of an SQL statement without the reserved words ORDER BY.

Remarks

You can use the Sort property with dynaset- and snapshot-type Recordset objects.

When you set this property for an object, sorting occurs when a subsequent Recordset object is created from that object. The Sort property setting overrides any sort order specified for a QueryDef object.

The default sort order is ascending (A to Z or 0 to 100).

The Sort property doesn't apply to table- or forward-only–type Recordset objects. To sort a table-type Recordset object, use the Index property.

Note In many cases, it's faster to open a new Recordset object by using an SQL statement that includes the sorting criteria.