if you are using ADODB, you can use its Sort property to order the records in other ways on the client side:RecordSet.Sort = "au_lname ASC, au_fname ASC"

解决方案 »

  1.   

    我觉得不改程序是不太好办喽。有一个办法可以试一下,就是在要排序的字段上加上聚集索引,绝大多数情况下这样select出来的结果集是按聚集索引的顺序的,但是也不能完全保证。而加聚集索引也可能不能成功(因为可能有重复值),也可能会对性能有不好的影响。所以不怎么好。还有一个办法,将这个表改名,比如叫orgtable,再建一个view,如下:
    create view mytable as 
    select top 100 percent * from orgtable 
    order by id
    这样,原来的select * from mytable实际上是去查询视图了,就有顺序了。
    但这样也有缺点,因为这个视图是不可更新的,所有的修改操作都不能进行了。