Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

ADO 排序 属性


❮ 记录集对象完整参考

Sort 属性设置或返回一个字符串值,该值指定要对其排序的 Recordset 中的字段名称。每个字段名称必须用逗号分隔。要选择排序顺序,可以在字段名称后指定 ASC(升序)或 DESC(降序)。默认值为 ASC。

注意:仅当 CursorLocation 属性设置为 adUseClient 时,才能使用此属性。

提示:如果将此属性设置为空字符串 (rs.Sort=""),则会将记录重置为其原始顺序。


语法

objRecordset.Sort

示例

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



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



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

❮ 记录集对象完整参考
×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.