472,143 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

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.
Thans
Richard
Jul 29 '07 #1
1 1766
jhardman
3,406 Expert 2GB
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.

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
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.