还是分页的问题,我的页码显示,指向的页码也对,但是下面的数据没有变化,也没报错!!为什么

datongshijie 2003-11-20 11:34:31
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<title>文件查询</title>
<head>
<%
const MaxPerPage=3
dim sql
dim rs
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim page
page=1
%>
</head>
<body>
<%
word=trim(request("word"))
dim mycon,con
Set con=Server.CreateObject("ADODB.Connection")
mycon= "DRIVER=Microsoft Access Driver (*.mdb);DBQ="&Server.MapPath("/zhuboyi.mdb")
con.open mycon

set rs=server.createobject("ADODB.Recordset")
rs.open "select Detail,Title,Date from new order by Date desc",MyCon,1,1
if not(rs.eof and rs.bof) then
rs.movefirst
end if

rs.pagesize=MaxPerPage
howmanyfields=rs.Fields.Count-1


If trim(Request("word"))<>"" then
CurrentPage= page
If CurrentPage> rs.PageCount then
CurrentPage = rs.PageCount
End If
Else
CurrentPage= 1
End If

if rs.eof then
response.write "<p align='center'> 没有查到要查的记录!</p>"
else
totalPut=rs.recordcount
if CurrentPage<>1 then
if (currentPage-1)*MaxPerPage<totalPut then
rs.move(currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
end if
end if

dim n,k
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if%>
</FONT></P>
<P>    第<%=currentpage%>页,共<%=n%>页。共找到<%=rs.recordcount%> 条符合条件的纪录。</P>
<P>   
<% k=currentPage
if k<>1 then
response.write "[<b>"+"<a href='dongtai6.asp?page=1'>首页</a></b>] "
response.write "[<b>"+"<a href='dongtai6.asp?page="+cstr(k-1)+"'>上一页</a></b>] "
else
Response.Write "[首页] [上一页]"
end if
if k<>n then
response.write "[<b><a href='dongtai6.asp?page="+cstr(k+1)+"'>下一页</a></b>] "
response.write "[<b><a href='dongtai6.asp?page="+cstr(n)+"'>尾页</a></b>] "
else
Response.Write "[下一页] [尾页]"
end if
%>
</P>

<%

For i = 1 to rs.PageSize
if rs.EOF then
Exit For
end if '利用for next 循环依次读出记录
%>
<table width=95% border=1 align=center>
<tr>
<td width="2%" height="17"><img src="images/dot.gif" width="6" height="6" border="0"></td>
<td width="3%" height="17"><img src="images/arrow.gif" width="5" height="5"></td>
<td width="443" height="17"><% =rs("Detail") %><br><% =rs("Title") %></td>
<td width="74" height="17"><% =rs("Date") %></td>

</tr> </table>
<%
rs.MoveNext
Next
%>

<%
end if
rs.close
set rs=nothing
%>
</body>
</html>
...全文
149 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jace583 2003-11-20
  • 打赏
  • 举报
回复
up
ygghost 2003-11-20
  • 打赏
  • 举报
回复
datongshijie 2003-11-20
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2475/2475890.xml?temp=.5479395

有人帮我弄出来了

28,405

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧