'Declare local variables
Dim conn
Dim rs
Dim strconn
Dim DBQValue
' Create an ADO Connection to connect to the scratch database.
Set conn =
Server.CreateObject("ADODB.Connection")
'conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
'Server.MapPath("../telephone/telephone.mdb") ";"
OR
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" Server.MapPath ("../telephone/telephone.mdb") ";"
' Execute a query using the connection object. It automatically
' creates and returns a recordset which we store in our variable.
Set rs =
Server.CreateObject("ADODB.Recordset")
Set rs =
conn.Execute("SELECT * FROM telephone order by FirstName;")
%>
<HTML>
<HEAD>
<TITLE>ListBox Down</TITLE>
</HEAD>
<BODY>
<!--If you want to make it so only one option can
be selected, then just take away the multiple and make size =
"1"-->
<SELECT align = top name ="FirstName" size =
"1"><BR>
<% Do While Not rs.EOF %>
<Option value = "<%rs.Fields("FirstName").value
%>"><%= rs.Fields("FirstName").value %></option>
<% = rs.movenext %> loop %></SELECT>
< SELECT NAME="Cars" SIZE=
"1">
<OPTION VALUE="1">BMW
<OPTION VALUE="2">PORSCHE
<OPTION VALUE="3"
SELECTED>MERCEDES
</SELECT>
'Close all your objects and set to nothing
'This helps clear unused objects out of the Server's Memory
rs.close
conn.close
set rs = nothing
set conn =
nothing
%>