CodeAve.com CodeAve.com - ASP - Database Table Display
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Writing Records To A Dropdown Menu
Writing records from a db out to a drop down menu is as easy as writing them out to a page. The example below queries our Simpson's db for the title of 15 episodes.  Note the output dropdown menu also utilizes server.urlencode  to convert the output in the option value field. 
View the Output
Text View
Print View
Mail this Link
Download the Code
View the Data

<%
accessdb="simpsons" 
cn="DRIVER={Microsoft Access Driver (*.mdb)};"
cn=cn & "DBQ=" & server.mappath(accessdb)
Set rs = Server.CreateObject("ADODB.Recordset")
rs.maxrecords=15

sql = "select title from shows" 

rs.Open sql, cn
%>



<select size="1" name="variable_name">
<option selected value="">Titles</option>

<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
title= rs("title") %>


<option value="<%= server.urlencode(title)%>"><%= title %></option>


<%
rs.MoveNext
loop%>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3