nbsp; <tr>
<td>
<!--(4)用循环显示本页记录-->
<% For i = 1 To rs.pagesize %>
<!-- 你的记录显示代码//-->
<%
rs.MoveNext
If rs.EOF Then
Exit For
rs.close
conn.close
End If
next
%>
</td>
</tr>
</table>
</body>
</html>
<二> 分页控制代码:
navigator_init.inc
<%
theCurrentPageNum = clng(request("pn"))
' 用页面名字来唯一确定当前页面使用的 rs
' 由于不同目录下面可以有相同名字的文件,因此使用带完整路径的文件名
theCurrentRS = "rs" & theScript
If theCurrentPageNum = 0 Then
Set conn = Server.CreateObject("ADODB.Connection")
conn.open myconnstr
set rs = server.createobject("adodb.recordset")
rs.open uSQL,conn,1,3
if rs.recordcount > 0 then
rs.PageSize = thePageSize
rs.AbsolutePage = 1
theCurrentPageNum = 1
&nb
<td>
<!--(4)用循环显示本页记录-->
<% For i = 1 To rs.pagesize %>
<!-- 你的记录显示代码//-->
<%
rs.MoveNext
If rs.EOF Then
Exit For
rs.close
conn.close
End If
next
%>
</td>
</tr>
</table>
</body>
</html>
<二> 分页控制代码:
navigator_init.inc
<%
theCurrentPageNum = clng(request("pn"))
' 用页面名字来唯一确定当前页面使用的 rs
' 由于不同目录下面可以有相同名字的文件,因此使用带完整路径的文件名
theCurrentRS = "rs" & theScript
If theCurrentPageNum = 0 Then
Set conn = Server.CreateObject("ADODB.Connection")
conn.open myconnstr
set rs = server.createobject("adodb.recordset")
rs.open uSQL,conn,1,3
if rs.recordcount > 0 then
rs.PageSize = thePageSize
rs.AbsolutePage = 1
theCurrentPageNum = 1
&nb
| 对此文章发表了评论 |
