<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("/db/demo.mdb")) set rs=Server.CreateObject("ADODB.recordset") sql="SELECT DISTINCT WebName FROM Web ORDER BY WebName" rs.Open sql,conn webname=request.form("webname") %> 网站名称 <% do until rs.EOF response.write("") response.write(rs.fields("WebName")) rs.MoveNext loop rs.Close set rs=Nothing %> <% if webname<>"" then sql="SELECT * FROM Web WHERE WebName='" & webname & "'" set rs=Server.CreateObject("ADODB.Recordset") rs.Open sql,conn %> WebID WebName WebLink <% do until rs.EOF response.write("") response.write("" & rs.fields("WebID") & "") response.write("" & rs.fields("WebName") & "") response.write("" & rs.fields("WebLink") & "") response.write("") rs.MoveNext loop rs.close conn.Close set rs=Nothing set conn=Nothing%> <% end if %>
效果会显示在右边 Create by 软晨网(RuanChen.com)