求助,ASP不能分页,高手请看!!

szlx169 2009-08-30 01:56:50
Recordset1.AbsolutePage= CLng(PageNo) 提示有错误,取消此行内容,网页正常,可以显示有几页数字(分页数),点击第二页后就没显示了。。。急!!


代码如下:






<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/ttl.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("type") <> "") Then
Recordset1__MMColParam = Request.QueryString("type")
End If
%>
<%
Dim I
Dim RPP
Dim PageNo
I=1
RPP=3
PageNo=CInt(Request("PageNo"))
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_ttl_STRING
Recordset1.Source = "SELECT * FROM pic WHERE type = '" + Replace(Recordset1__MMColParam, "'", "''") + "' ORDER BY id DESC"
Recordset1.CursorType = 1
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
Recordset1.PageSize=RPP
If PageNo<=0 Then PageNo=1
If PageNo>Recordset1.PageCount Then PageNo=Recordset1.PageCount
Recordset1.AbsolutePage= CLng(PageNo) (错误地方,取消该行,可以显示,且有分页数字,但点击第2页后就不行了,不显示结果)
Sub ShowPageInfo(tPageCount,cPageNo)
Response.Write "第"&cPageNo&"页[共"&tPageCount&"页]"
End Sub

Sub ShowPageNavi(tPageCount,cPageNo)
If cPageNo<1 Then cPageNo=1
If tPageCount<1 Then tPageCount=1
If cPageNo>tPageCount Then cPageNo=tPageCount
Dim NaviLength
NaviLength=tPageCount
Dim I,StartPage,EndPage
StartPage=(cPageNo\NaviLength)*NaviLength+1
If (cPageNo Mod NaviLength)=0 Then StartPage=StartPage-NaviLength
EndPage=StartPage+NaviLength-1
If EndPage>tPageCount Then EndPage=tPageCount
If StartPage>1 Then
Response.Write "<a class=""pageNavi"" href=""?PageNo=" & (cPageNo-NaviLength) & """><<</a> "
Else
Response.Write "<font color=""#CCCCCC""><<</font> "
End If
For I=StartPage To EndPage
If I=cPageNo Then
Response.Write "<b>"&I&"</b>"
Else
Response.Write "<a class=""pageNavi"" href=""?PageNo=" & I & """>" & I & "</a>"
End If
If I<>tPageCount Then Response.Write " "
Next
If EndPage<tPageCount Then
Response.Write " <a class=""pageNavi"" href=""?PageNo=" & (cPageNo+NaviLength) & """>>></a>"
Else
Response.Write " <font color=""#CCCCCC"">>></font> "
End If
End Sub

%>
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_ttl_STRING
Recordset2.Source = "SELECT * FROM type ORDER BY ID1 ASC"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
%>

...全文
39 点赞 收藏 5
写回复
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lichong876140 2009-08-31
Recordset1.AbsolutePage= PageNo
回复
szlx169 2009-08-31
高手在吗?
回复
szlx169 2009-08-31
不行哦,试过的,原来就是这样Recordset1.AbsolutePage= PageNo
回复
jerr_yun 2009-08-30
我来看看 。
回复
szlx169 2009-08-30
高手在吗?
回复
发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告