案例:ASP/ADO/VBScript案例     状态:不可编辑再运行    进入横版
x
   sql="SELECT Companyname,Contactname,Country FROM Customers WHERE country='" & country & "'"
 
1
<html>
2
<body>
3
4
<%
5
set conn=Server.CreateObject("ADODB.Connection")
6
conn.Provider="Microsoft.Jet.OLEDB.4.0"
7
conn.Open(Server.Mappath("/db/northwind.mdb"))
8
9
set rs=Server.CreateObject("ADODB.recordset")
10
sql="SELECT DISTINCT Country FROM Customers ORDER BY Country"
11
rs.Open sql,conn
12
13
country=request.form("country")
14
15
%>
16
17
<form method="post">
18
Choose Country <select name="country">
19
<%  do until rs.EOF
20
    response.write("<option")
21
    if rs.fields("country")=country then
22
      response.write(" selected")
23
    end if
24
    response.write(">")

 运行结果 
 北美留学生论坛