在客户端执行数据库记录的分页显示----3
来源:岁月联盟
时间:2003-04-19
<!--#include file="dhtmlGetRows.class.asp"-->
<%
'Create and populate a Recordset
Dim objRS, objConn, strSQL
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=MyDSN"
strSQL = "SELECT TOP 25 ViewCount, Description " & _
"FROM tblFAQ ORDER BY ViewCount DESC"
Set objRS = objConn.Execute(strSQL)
'Create an instance of the dhtmlGetRows class
Dim objPagedResults
Set objPagedResults = new dhtmlGetRows
objPagedResults.THString = "<th>Views</th><th>FAQ Question</th>"
Response.Write objPagedResults.GenerateHTML(objRS)
'Clean up...
Set objPagedResults = Nothing
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
以上的代码片段假定dhtmlGetRows类可以在一个服务器端包含文件dhtmlGetRows.class.asp中使用。