ASP

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Sort RecordSet once its returned?

    2 answers - 184 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Can I sort my ADODB.Recordset by a field once the recordset is already created or should I be doing this at the SQL SELECT level / point?
    Is there a sort option for the recordset?
  • No.1 | | 337 bytes | |

    it's easier to sort it in SQL

    just add ORDER BY fieldname at the end with ASC (ascending) or DESC (descending) at the end. You can have multiple order by fields also, the non-primary fields are used when the primary fields are equal

    eg

    SELECT * FROM mytable ORDER BY myimportantcolumn, myimportantcolumn2
  • No.2 | | 219 bytes | |

    After the RecordSet is created you cannot sort records in the RecordSet. But I think there is a way to sort them using ASP code. That may reduce the performance. Why don't you sort the records in the SQL statement?

Re: Sort RecordSet once its returned?


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
QUESTION ON "ASP"

DATABASE TECH