有你这么翻页的? 我只有给你加个JS来实现:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
response.Expires=0 '使浏览器缓存的页面立即过期
const intpagesize=3
'intcur代表当前要显示的页数,inttotal代表总页面,i代表循环变量
dim intcur,inttotal,i
dim rs
if request.ServerVariables("content_length")=0 then
intcur=1
else
intcur=cint(request.form("curpage"))
select case request.form("page")
case"首页"
intcur=1
case"上一页"
intcur=intcur-1
case"下一页"
intcur=intcur+1
case"尾页"
intcur=cint(request.form("lastpage"))
end select
end if
set rs=server.CreateObject("adodb.recordset")
strsql="select * from book order by bookname"
rs.cursorlocation=3 'adUseClient
rs.cursortype=adOpenStatic
rs.cachesize=intpagesize
rs.open strsql,conn
if rs.recordcount=0 then
response.write"对不起,数据库中没有信息记录"
else
rs.pagesize=intpagesize
if not rs.eof then
rs.absolutepage=intcur '设置当前记录所在的页号
end if
inttotal=rs.pagecount '获得总页数
%>
编号 | 书名 | 作者 | 价格 | 类型 |
<%=rs.absoluteposition%> | <%=rs("bookname")%> | <%=rs("writer")%> | <%=rs("price")%> | <%=rs("type")%> |
文件display.asp的代码如下:自己看代码用SQL建立一个数据库名为:student ,表名为: table ,字段随便设置
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>