VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Populates a drop down menu from the contents of a table in a database

by Graham Hayes (3 Submissions)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Thu 3rd July 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Populates a drop down menu from the contents of a table in a database

Rate Populates a drop down menu from the contents of a table in a database



          <option value="0">Any</option>
          <%
   sql="SELECT * FROM CarMakes Order By Make"
set recordset=conn.execute(sql)' starts a connection to the database


do while not recordset.eof ' cycles through the contents of the table

response.Write("<option value=" & recordset("ID") & " >" & recordset("Make") & " </option>") ' creates an option from the database 
recordset.movenext
loop

%>
        </select>

Download this snippet    Add to My Saved Code

Populates a drop down menu from the contents of a table in a database Comments

No comments have been posted about Populates a drop down menu from the contents of a table in a database. Why not be the first to post a comment about Populates a drop down menu from the contents of a table in a database.

Post your comment

Subject:
Message:
0/1000 characters