Ask a Question related to ASP Database, Design and Development.
-
LC #1
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
-
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... -
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)? -
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,... -
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. -
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... -
Aaron [SQL Server MVP] #2
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
-
Aaron [SQL Server MVP] #3
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
-
lc #4
Re: Non-repeating items
It is not the same question.
an>-----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>>> 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
-
dave #5
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
-
joker #6
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
-
David C. Holley #7
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



Reply With Quote

