网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: ADO :: ADO Sort 属性

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

ADO Sort 属性


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:1209 :: ::

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