ADO Sort Property

The Sort property sets or returns a string value that specifies the field names in the Recordsetto sort on. Each field name must be separated by a comma. To choose the sortorder, you can specify ASC (ascending order), or DESC (descending order) afterthe field name. Default is ASC."

Syntax

objRecordset.Sort

Example

<%
rs.Sort="CompanyName,ContactName"
%>

or

<%
rs.Sort="CompanyName DESC,ContactName"
%>

or

<%
rs.Sort="CompanyName,ContactName,[Ship Address]"
%>

❮ Complete Recordset Object Reference