asp分页错误.如:共15条记录,分每页6条,到第三页时报错

来源:百度知道 编辑:UC知道 时间:2024/05/17 11:04:29
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Conn.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
dim rs

sql="select * from iXs_UpFiles"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
%>
<%
rs.pagesize=6
pagecount=rs.pagecount
page=int(request("page"))
if page<=0 then page=1
if request("page")="" then page=1
rs.absolutepage=page

%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Conte

用我这个翻页功能试试
我目前做的网站全部采用这样的写法
<!--#include file="conn.asp" -->
<%
Sub LastNextPage(pagecount,page,resultcount)
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next

Response.Write("<table cellspacing=0 cellpadding=0 border=0>" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
Response.Write("<TD align=right&