当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO Sort 属性

ADO
ADO DataTypes
ADO 摘要
ADO 实例

ADO Sort 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 364 ::
收藏到网摘: n/a

The Sort property sets or returns a string value that specifies the field names in the Recordset to sort on. Each field name must be separated by a comma. To choose the sort order, you can specify ASC (ascending order), or DESC (descending order) after the field name. Default is ASC.
Sort属性的作用是:设置或返回一个字符串值,用于指定记录集中需要进行排列的字段名称。每个字段名称必须通过逗点(,)分割。你可以在字段名之后指定ASC(升序排列)或DESC(降序排列)。

Note: This property can only be used if the CursorLocation property is set to adUseClient.
注意:只有当CursorLocation属性设置为asUseClient是才可以使用Sort属性。

Tip: If you set this property to an empty string (rs.Sort="") it will reset the records to their original order.
提示:如果你将该属性设置为空字符串(rs.Sort=""),那么它将默认为原始顺序。

Syntax
语法

objRecordset.Sort

Example
案例

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

or

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

or

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

评论 (0) All

登陆 | 还没注册?