Sorting Recordset

Results 1 to 2 of 2

Thread: Sorting Recordset

  1. #1
    Join Date
    Dec 1969

    Default Sorting Recordset

    Hi<BR><BR>I have a db-table with 4 colums. LinksURL, LinksName, LinksComment and LinksCategory. <BR><BR>What I would like to do is showing the content of the db in a ASP-page. But I would like LinksCategory to be used as Headline and then showing only the links in that category. Then the next category and so on.<BR><BR>Can anyone point me in the right direction?<BR><BR>Thanx

  2. #2
    Join Date
    Dec 1969

    Default RE: Sorting Recordset

    You could add something onto the end of your query.<BR><BR>Order By would jump to mind.<BR><BR>i.e.<BR>"SELECT * FROM [DBTableName] ORDER BY LinksCategory ASC, LinksName ASC".<BR><BR>This would order all the results firstly by linkscategory and then by linksname.<BR><BR>You could then just loop through your array and see if linkscategory changes. If it does, you&#039;ve entered a new category and must write out a header row. Otherwise, just write out the recordset row contents.<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts