Sorting recordset with 'index' letters

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Sorting recordset with 'index' letters

    Hi

    I am trying to create a recordset where the results are sorted into
    alphabetical order but also where an index letter is included at the top of
    each new first letter's list:

    ie.
    A
    Aardvark
    Apple
    Axe

    B
    Bee
    Brain
    Bus

    C
    Cat
    Chair

    Can anyone think how to do this?

    Thanks for any suggestions!

    TP

    tim-p Guest

  2. Similar Questions and Discussions

    1. Accented letters in "export Recordset As XML"
      Good Morning, i'm using "export Recordset As XML" i noticed that in the text strings inserted in the databse are used particular characters (in this...
    2. Sorting and subsorting recordset
      DMX 2004 MSSQL 2000 ASP/vbScript I want to sort a by a field and then by another within that fielld. Sort by Model and sort models by year. i.e...
    3. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
      Hey Folks,(New to .NET) This is driving me NUTZ... If anyone out there can resolve this from me I would greatly appreciate it... Line 238: Line...
    4. RecordSet.Move or RecordSet.AbsolutePosition??
      Hi, I'm trying to use either one of these methods to position the cursor in a specific position inside a recordset, but neither one seems to...
    5. Newb query: index.htm & index.php & the server default
      The problem I'm trying to solve is as follows: The website has two subdirectories: /ordinary and /phpstuff. Users typing hostname/ordinary get the...
  3. #2

    Default Re: Sorting recordset with 'index' letters

    This is how you do it in ASP.

    Firstly make sure that the you sort the recordset output in alphabetical
    order. Then you would use the following code on the page

    <%
    Dim ThisLetter, TestLetter, TestName
    ThisLetter = ""
    %>

    'Start of Repeat Region
    TestName = recordset.fields.Item("NameField").value
    TestLetter = Left(TestName,1)

    If ThisLetter <> TestLetter then
    response.write ("<p>") & TestLetter
    ThisLetter = TestLetter
    End if
    Response.Write ("<br>") & TestName

    'End of Repeat Region

    Once you have positioned the code then wrap the areas denoted by the Start &
    End Comments in a dreamweaver created repeat region

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "tim-p" <webforumsuser@macromedia.com> wrote in message
    news:d5sv2t$gcf$1@forums.macromedia.com...
    > Hi
    >
    > I am trying to create a recordset where the results are sorted into
    > alphabetical order but also where an index letter is included at the top
    of
    > each new first letter's list:
    >
    > ie.
    > A
    > Aardvark
    > Apple
    > Axe
    >
    > B
    > Bee
    > Brain
    > Bus
    >
    > C
    > Cat
    > Chair
    >
    > Can anyone think how to do this?
    >
    > Thanks for any suggestions!
    >
    > TP
    >

    Paul Whitham TMM Guest

  4. #3

    Default Re: Sorting recordset with 'index' letters

    Hi Paul

    Works a treat!

    Thank you very much for your help.

    Tim P
    tim-p Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139