codice:
<%
' Inizializzazione oggetti
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("mdb-database/iscritti.mdb")
SQL = "SELECT * FROM iscritti where tipo ='iscritto' order by cognome asc"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open SQL, Conn, 1, 3
%>
do while not rs.EOF
Response.Write ("<OPTION ")
Response.Write ("value=""" & rs("cognome") & """>")
Response.Write (rs("cognome"))
Response.Write ("</OPTION>")
rs.MoveNext 'va al successivo
loop 'ritorna sopra
%>
<input type="submit" value="RICERCA" name="RICERCA"></td>
<%
Conn.close
Set Conn = nothing
%>
SCRIPT RISULTATI
<%
cog=Request.Form("cog")
'cognome = request.querystring ("cognome")
response.write cog
%>
SQL="SELECT * FROM iscritti WHERE cognome = '" & cog & '"
'' SQL="SELECT * FROM iscritti WHERE id ="& id
%>
<%
Set rec = Server.CreateObject("ADODB.Recordset")
Set Rec=Conn.Execute(SQL)
While Not rec.EOF
%>