大侠帮忙,分页问题!急,在线等!!问题解决,马上给分。
<%@LANGUAGE= "VBSCRIPT " CODEPAGE= "936 "%>
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 无标题文档 </title>
<style type= "text/css ">
<!--
.style1 {font-size: 12px}
-->
</style>
</head>
<body>
<!--#include file= "conn.asp " -->
<% OpenDB()
Set rs = Server.CreateObject ( "ADODB.Recordset ")
sql= "select id,title,content,subid from TravelNews where subid=2 "
rs.Open sql, conn, 3,1
'dim sql,rs
'sql= "select id,title,content,subid from TravelNews where subid=2 "
'set rs=conn.execute(sql) '将记录读到RS中
'if rs.eof or rs.bof then
'response.Write( "没有新闻! ")
'response.End()
'end if
%>
<%
rs.PageSize = 2
curpage=cint(Request.QueryString( "Page "))
if IsEmpty(curpage) or curpage= " " or isnull(curpage) then '第一次调用时
CurPage = 1
rs.AbsolutePage=CurPage
else
if CurPage> rs.PageCount then
CurPage=rs.PageCount
rs.AbsolutePage=CurPage
elseif request( "Page ") <= 0 then
CurPage = 1
rs.AbsolutePage=CurPage
else
rs.AbsolutePage = CurPage
end if
End if
'abpage=rs.absolutepage//如果把rs.absolutepage记下来,再在 “当前是第 <%=abpage%> 页”处调用显示是正常的,但是如果不把rs.absolutepage用变量记下来,也就是去掉“abpage=rs.absolutepage”,到后边直接用“当前是第 <%=rs.absolutepage%> 页”就会出先负数,为什么啊?是不是“rs.movenext”对“rs.absolutepage”有影响啊?
%>
<%
for i=1 to rs.pagesize
if rs.eof then
exit for
end if
%>
<table width= "765 " >
<tr>
<td width= "490 "> <span class= "style1 "> <%=rs( "title ")%> </span> </td>
<td width= "126 "> <div align= "center "> <a href= "SubE