<html> <body> <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("/db/northwind.mdb")) set rs=Server.CreateObject("ADODB.recordset") sql="SELECT DISTINCT Country FROM Customers ORDER BY Country" rs.Open sql,conn country=request.form("country") %> <form method="post"> Choose Country <select name="country"> <% <big> do until rs.EOF response.write("<option") if rs.fields("country")=country then response.write(" selected") end if response.write(">") response.write(rs.fields("Country")) rs.MoveNext</big> loop rs.Close set rs=Nothing %> </select> <input type="submit" value="Show customers"> </form>
select
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)