Home
Developer Blog
Ajax effects
CSS examples
Freelance jobs
Hot IT Jobs
Hot scripts
Code samples
Web hosting directory
Lotus Notes FAQ
See the new scripts recently added to Dynamic Drive.
Click here
.
Original, practical
CSS codes and examples
such as CSS menus for your site.
Search code samples
Keyword
All Categories
ASP
CSS
Dhtml
Html
Javascript
PHP
Code Samples
ASP
CSS
Dhtml
Html
Javascript
PHP
LOGIN HERE
Username
Password
Signup Now
Forgot Password
Verify Signup
ASP >> Database
How do I populate a combo box with values from a table in a database?
Visitor Ratings (4) :
Description
you can use do while loop.
Code
Select All
<form name="formname" method="post" action="test.asp"> <TABLE BORDER ="1" bgcolor="#7CCEFA"> <TR> <TD>Select the country</TD> </TR> <TR> <td><select name="country_name" class="pulldown"> <%Set Connect = Server.CreateObject("ADODB.Connection") Connect.Open "DSN=xxxxx; UID=xxxx" LocationSQL = "SELECT * FROM bcLocation " Set rs = Connect.Execute(LocationSQL) WHILE Not rs.EOF%> <option value="<%=rs("LOC_CD")%>"><%=rs("DESCRIPTION")%></option> <%rs.MoveNext Wend %> <option selected><%=pick_up%> </select> </td> </TR> </TABLE>
Rate this Resource
0
1
2
3
4
5
6
7
8
9
10