页面分页显示的问题,点击下一页,下面并没有调新的信息出来!!帮帮忙!!!
<%@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("/zhu.mdb")
con.open mycon
set rs=server.createobject("ADODB.Recordset")
rs.open "select Detail,Title,Date from new where id like '%"&word&"%'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)+"&word="+word+"'>上一页</a></b>] "
else
Response.Write "[首页] [上一页]"
end if
if k<>n then
response.write "[<b><a href='dongtai6.asp?page="+cstr(k+1)+"&word="+word+"'>下一页</a></b>] "
response.write "[<b><a href='dongtai6.asp?page="+cstr(n)+"&word="+word+"'>尾页</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=0 align=center cellpadding="0" cellspacing="1">
<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>
</td>
<td width="74" height="17"><% =rs("Date") %></td>
</tr> </table>
<%
rs.MoveNext
Next
%>
<%
end if
rs.close
set rs=nothing
%>
</body>
</html>