ID Name <% if request.querystring("sort")<>"" then sort=request.querystring("sort") else sort="webid" end if 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 WebID, WebName FROM Web 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 %>
效果会显示在右边 Create by 软晨网(RuanChen.com)