教程之家 TIY Editor
教程之家
改变方向
暗黑模式
Company
Contact
<% if request.querystring("sort")<>"" then sort=request.querystring("sort") else sort="companyname" end if 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 Companyname,Contactname FROM Customers ORDER BY " & sort rs.Open sql,conn do until rs.EOF response.write("
") for each x in rs.Fields response.write("
" & x.value & "
") next rs.MoveNext response.write("
") loop rs.close conn.close %>