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

  1. #1

    Default Non-repeating items

    Hi,

    Lets say I connected to an Access database and created an
    sql and then created a drop down list.

    <%
    strSQL = "SELECT tblEV3Location.Division,
    tblEV3Location.Code FROM tblEV3Location
    ORDER BY tblEV3Location.Division;"

    set cars=adoCon.execute(strSQL)
    %>

    <select name="Division">
    <% 'Loop through the recordset to make each entry
    in the list. %>
    <% do while not cars.eof %>
    <Option value = "<%= cars(1) %>"> <%= cars
    (0) %></Option>
    <%cars.movenext
    loop%>
    </select>

    How can I make the drop down contain unqiue values that
    is not repeating any of the items in the list?

    Any help appreciated.
    Thanks.

    LC Guest

  2. Similar Questions and Discussions

    1. Creating master page where global items arearranged ABOVE local items
      When you create a mater page, obviously all the items are arranged below anything on the individual pages. Is there a way of creating a master...
    2. Selecting items from DataSet items collection that werechanged
      hello. how to choose items from DataSet items collection that were changed (for example added to collection, changed)?
    3. JavaScript: html list items within list items?
      Hi, I've seen how to implement a JavaScript to change the CSS class of every other list item in an unordered list, but, being new to JavaScript,...
    4. possible for publishers to edit Library Items /recurrent items like navigation?
      I'd love to see this possibility too, but I think it's not possible.
    5. possible for publishers to edit Library Items / recurrent items like navigation?
      No, you have to use an include of some sort. If you don't want to use SSI you can do it with Javascript. Search Google with the keyword "Javascript...
  3. #2

    Default Re: Non-repeating items

    Why are you posting the same question again?

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)




    "LC" <lc@hotmail.com> wrote in message
    news:5e2901c474d1$cd9f42d0$a601280a@phx.gbl...
    > Hi,
    >
    > Lets say I connected to an Access database and created an
    > sql and then created a drop down list.
    >
    > <%
    > strSQL = "SELECT tblEV3Location.Division,
    > tblEV3Location.Code FROM tblEV3Location
    > ORDER BY tblEV3Location.Division;"
    >
    > set cars=adoCon.execute(strSQL)
    > %>
    >
    > <select name="Division">
    > <% 'Loop through the recordset to make each entry
    > in the list. %>
    > <% do while not cars.eof %>
    > <Option value = "<%= cars(1) %>"> <%= cars
    > (0) %></Option>
    > <%cars.movenext
    > loop%>
    > </select>
    >
    > How can I make the drop down contain unqiue values that
    > is not repeating any of the items in the list?
    >
    > Any help appreciated.
    > Thanks.
    >

    Aaron [SQL Server MVP] Guest

  4. #3

    Default Re: Non-repeating items

    Uh, why would it have repeating items? Do you not have a primary key on
    tblEV3Location? If not, why not?

    What's with the tbl prefix? Why use the tablename prefix throughout the
    query when you're only referencing one table?

    SELECT Division, Code
    FROM tblEV3Location
    GROUP BY Division, Code
    ORDER BY Division

    If that doesn't do what you want, see [url]http://www.aspfaq.com/5006[/url] -- which
    deals with providing us enough information so that we understand the problem
    and your requirements.

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)




    "LC" <lc@hotmail.com> wrote in message
    news:5e2901c474d1$cd9f42d0$a601280a@phx.gbl...
    > Hi,
    >
    > Lets say I connected to an Access database and created an
    > sql and then created a drop down list.
    >
    > <%
    > strSQL = "SELECT tblEV3Location.Division,
    > tblEV3Location.Code FROM tblEV3Location
    > ORDER BY tblEV3Location.Division;"
    >
    > set cars=adoCon.execute(strSQL)
    > %>
    >
    > <select name="Division">
    > <% 'Loop through the recordset to make each entry
    > in the list. %>
    > <% do while not cars.eof %>
    > <Option value = "<%= cars(1) %>"> <%= cars
    > (0) %></Option>
    > <%cars.movenext
    > loop%>
    > </select>
    >
    > How can I make the drop down contain unqiue values that
    > is not repeating any of the items in the list?
    >
    > Any help appreciated.
    > Thanks.
    >

    Aaron [SQL Server MVP] Guest

  5. #4

    Default Re: Non-repeating items

    It is not the same question.
    >-----Original Message-----
    >Why are you posting the same question again?
    >
    >--
    >[url]http://www.aspfaq.com/[/url]
    >(Reverse address to reply.)
    >
    >
    >
    >
    >"LC" <lc@hotmail.com> wrote in message
    >news:5e2901c474d1$cd9f42d0$a601280a@phx.gbl...
    >> Hi,
    >>
    >> Lets say I connected to an Access database and created
    an
    >> sql and then created a drop down list.
    >>
    >> <%
    >> strSQL = "SELECT tblEV3Location.Division,
    >> tblEV3Location.Code FROM tblEV3Location
    >> ORDER BY tblEV3Location.Division;"
    >>
    >> set cars=adoCon.execute(strSQL)
    >> %>
    >>
    >> <select name="Division">
    >> <% 'Loop through the recordset to make each entry
    >> in the list. %>
    >> <% do while not cars.eof %>
    >> <Option value = "<%= cars(1) %>"> <%= cars
    >> (0) %></Option>
    >> <%cars.movenext
    >> loop%>
    >> </select>
    >>
    >> How can I make the drop down contain unqiue values that
    >> is not repeating any of the items in the list?
    >>
    >> Any help appreciated.
    >> Thanks.
    >>
    >
    >
    >.
    >
    lc Guest

  6. #5

    Default Re: Non-repeating items

    strSQL = "SELECT DISTICT tblEV3Location.Division, ..........



    "LC" <lc@hotmail.com> wrote in message
    news:5e2901c474d1$cd9f42d0$a601280a@phx.gbl...
    > Hi,
    >
    > Lets say I connected to an Access database and created an
    > sql and then created a drop down list.
    >
    > <%
    > strSQL = "SELECT tblEV3Location.Division,
    > tblEV3Location.Code FROM tblEV3Location
    > ORDER BY tblEV3Location.Division;"
    >
    > set cars=adoCon.execute(strSQL)
    > %>
    >
    > <select name="Division">
    > <% 'Loop through the recordset to make each entry
    > in the list. %>
    > <% do while not cars.eof %>
    > <Option value = "<%= cars(1) %>"> <%= cars
    > (0) %></Option>
    > <%cars.movenext
    > loop%>
    > </select>
    >
    > How can I make the drop down contain unqiue values that
    > is not repeating any of the items in the list?
    >
    > Any help appreciated.
    > Thanks.
    >

    dave Guest

  7. #6

    Default Re: Non-repeating items

    Don't you mean 'strSQL = "SELECT DISTINCT tblEV3Location.Division,
    ...........'?

    dave wrote:
    > strSQL = "SELECT DISTICT tblEV3Location.Division, ..........
    >
    >
    >
    > "LC" <lc@hotmail.com> wrote in message
    > news:5e2901c474d1$cd9f42d0$a601280a@phx.gbl...
    >
    >>Hi,
    >>
    >>Lets say I connected to an Access database and created an
    >>sql and then created a drop down list.
    >>
    >><%
    >>strSQL = "SELECT tblEV3Location.Division,
    >>tblEV3Location.Code FROM tblEV3Location
    >>ORDER BY tblEV3Location.Division;"
    >>
    >>set cars=adoCon.execute(strSQL)
    >>%>
    >>
    >><select name="Division">
    >><% 'Loop through the recordset to make each entry
    >>in the list. %>
    >><% do while not cars.eof %>
    >><Option value = "<%= cars(1) %>"> <%= cars
    >>(0) %></Option>
    >><%cars.movenext
    >>loop%>
    >></select>
    >>
    >>How can I make the drop down contain unqiue values that
    >>is not repeating any of the items in the list?
    >>
    >>Any help appreciated.
    >>Thanks.
    >>
    >
    >
    >
    joker Guest

  8. #7

    Default Re: Non-repeating items

    My suspicion is that the underlying database design could use some work.
    Why would you ever have more than one division if the table contains
    details on all of the divisions?

    David H

    joker wrote:
    > Don't you mean 'strSQL = "SELECT DISTINCT tblEV3Location.Division,
    > ..........'?
    >
    > dave wrote:
    >
    >> strSQL = "SELECT DISTICT tblEV3Location.Division, ..........
    >>
    >>
    >>
    >> "LC" <lc@hotmail.com> wrote in message
    >> news:5e2901c474d1$cd9f42d0$a601280a@phx.gbl...
    >>
    >>> Hi,
    >>>
    >>> Lets say I connected to an Access database and created an
    >>> sql and then created a drop down list.
    >>>
    >>> <%
    >>> strSQL = "SELECT tblEV3Location.Division,
    >>> tblEV3Location.Code FROM tblEV3Location
    >>> ORDER BY tblEV3Location.Division;"
    >>>
    >>> set cars=adoCon.execute(strSQL)
    >>> %>
    >>>
    >>> <select name="Division">
    >>> <% 'Loop through the recordset to make each entry
    >>> in the list. %>
    >>> <% do while not cars.eof %>
    >>> <Option value = "<%= cars(1) %>"> <%= cars
    >>> (0) %></Option>
    >>> <%cars.movenext
    >>> loop%>
    >>> </select>
    >>>
    >>> How can I make the drop down contain unqiue values that
    >>> is not repeating any of the items in the list?
    >>>
    >>> Any help appreciated.
    >>> Thanks.
    >>>
    >>
    >>
    >>
    >
    David C. Holley 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