469,917 Members | 1,874 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

asp populate a dropdown list

229 100+
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.
Jul 29 '07 #1
1 1677
3,406 Expert 2GB

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.

Jul 30 '07 #2

Post your reply

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

Similar topics

3 posts views Thread by Dmitry Korolyov [MVP] | last post: by
4 posts views Thread by anonymous | last post: by
1 post views Thread by Mark Goldin | last post: by
3 posts views Thread by Merdaad | last post: by
3 posts views Thread by JIM.H. | last post: by
1 post views Thread by Johhn | last post: by
11 posts views Thread by eureka | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.