By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,826 Members | 815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,826 IT Pros & Developers. It's quick & easy.

asp populate a dropdown list

100+
P: 229
Hi, Anyone know how to populate a dropdown list with data from database.

I have an interface that generates the following code for names in my database.


Expand|Select|Wrap|Line Numbers
  1. ..asp
  2. <%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%>
  3. ..
How does one populate a dropdown list??
Any ideas would be greatly appreciated.
Thans
Richard
Jul 29 '07 #1
Share this Question
Share on Google+
1 Reply


jhardman
Expert 2.5K+
P: 3,405
Richard,

rsCard should contain a whole set of data, you should be able to scroll through them by saying rsCard.movenext, so the drop down select will look something like this:
Expand|Select|Wrap|Line Numbers
  1. response.write "<select>"
  2. do until rsCard.eof 'scroll through the whole list
  3.    response.write "<option>" & rsCard("Author") & "</option>" & vbNewLine
  4.    rsCard.movenext
  5. loop
  6. response.write "</select>"
Let me know if this helps.

Jared
Jul 30 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.