Sorting a list held in a database

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Sorting a list held in a database

    Hi all,

    I need to build a list of text items. Using asp I want to add text items to
    a list and then sort the list in the order I wish.

    The easiest and most flexible method I think would be to have a text box
    next to each item in the list. The list can then be sorted by placing your
    own numerical order next to each item and selecting a sort button.

    New items are placed, sorted and removed on the list everyday. It will never
    be completely wiped. It is a kind of 'To Do List' for a group of people in
    my office.

    I want to use asp and an access database. I have been trying various
    incarnations of code to make this work but am having no luck.

    One method I tried involved using 2 fields, the text item and a priority
    field. The priority field would hold the count of objects in the list but in
    the required order.

    The list could be displayed in order using the 'sort by priority' field.
    However I could not come up with an efficient means to re-sort the list.

    Anyone have any ideas.


    William E Hatto Guest

  2. Similar Questions and Discussions

    1. Sorting Database Results in PHP
      I am working on putting a drop down menu on my page which allows the user to change the order of which he/she wants to view the database results,...
    2. Why Does Sorting Require Another Call To The Database?
      I hope someone can help with this. Every example I've seen, and every example I've written, where I fill a datagrid from a recordset I get from...
    3. Sorting the contents of a list backwards
      Is it possible to sort the contents of a list backwards? Put the values into an array the opposite way round? thanks m
    4. Sorting Font List takes forever!
      How many fonts are there?
    5. Sorting property list by the values
      Hello all I'm not sure if I can do this without an Xtra or summat... I have a property list like this: I want to sort this list by the...
  3. #2

    Default Re: Sorting a list held in a database

    William E Hatto wrote:
    > Hi all,
    >
    > I need to build a list of text items. Using asp I want to add text
    > items to a list and then sort the list in the order I wish.
    >
    > The easiest and most flexible method I think would be to have a text
    > box next to each item in the list. The list can then be sorted by
    > placing your own numerical order next to each item and selecting a
    > sort button.
    >
    > New items are placed, sorted and removed on the list everyday. It
    > will never be completely wiped. It is a kind of 'To Do List' for a
    > group of people in my office.
    >
    > I want to use asp and an access database. I have been trying various
    > incarnations of code to make this work but am having no luck.
    I don't understand what ha"having no luck" means.
    >
    > One method I tried involved using 2 fields, the text item and a
    > priority field. The priority field would hold the count of objects in
    > the list but in the required order.
    That's how I would do it ...
    >
    > The list could be displayed in order using the 'sort by priority'
    > field. However I could not come up with an efficient means to re-sort
    > the list.
    >
    Why not submit the changes to the database and retrieve the items in the
    proper order using an Oreder By clause in your query?

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

  4. #3

    Default Re: Sorting a list held in a database

    I would like to re-sort the list by entering numbers next to just those
    items requiring resorting, not re-number the hold list.

    eg. If I wanted to resort the list with item 3 at the top, I would just
    place a 1 next to item 3. The asp page would then re-sort the list.

    I want back end code to do the work not the user. Any idea's as to the code
    required to do this?



    "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:%23N8BpFFMEHA.3348@TK2MSFTNGP09.phx.gbl...
    > William E Hatto wrote:
    > > Hi all,
    > >
    > > I need to build a list of text items. Using asp I want to add text
    > > items to a list and then sort the list in the order I wish.
    > >
    > > The easiest and most flexible method I think would be to have a text
    > > box next to each item in the list. The list can then be sorted by
    > > placing your own numerical order next to each item and selecting a
    > > sort button.
    > >
    > > New items are placed, sorted and removed on the list everyday. It
    > > will never be completely wiped. It is a kind of 'To Do List' for a
    > > group of people in my office.
    > >
    > > I want to use asp and an access database. I have been trying various
    > > incarnations of code to make this work but am having no luck.
    >
    > I don't understand what ha"having no luck" means.
    > >
    > > One method I tried involved using 2 fields, the text item and a
    > > priority field. The priority field would hold the count of objects in
    > > the list but in the required order.
    >
    > That's how I would do it ...
    >
    > >
    > > The list could be displayed in order using the 'sort by priority'
    > > field. However I could not come up with an efficient means to re-sort
    > > the list.
    > >
    > Why not submit the changes to the database and retrieve the items in the
    > proper order using an Oreder By clause in your query?
    >
    > Bob Barrows
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >

    William E Hatto 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