asp分页代码
这是一段简单的asp分页显示代码并以asp 分页显示源代码的形式提供给大家,包手asp数字分页代码,asp的分页代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%
dim Conn,rs
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "Dbq="&Server.MapPath("liouyan.mdb")&"; Driver={Microsoft Access Driver (*.mdb)}"
Conn.Open
set rs=Server.createObject("ADODB.RecordSet")
SQL="select * from userinfo"
rs.open SQL,Conn,1,1
if Not rs.Bof and Not rs. Eof then
dim page_no
if request.QueryString("page_no")="" then
page_no=1
else
page_no=Cint(Request.QueryString("page_no"))
end if
rs.pageSize=5
rs.AbsolutePage=page_no
dim I
I=rs.pageSize
do while Not rs.Eof and I>0
I=I-1
response.write rs("username") &"对你说:"&rs("word")& "<br>"
rs.MoveNext
loop
response.write"请选择数据页:"
for I=1 to rs.pageCount
if I=page_no then
response.write I &" "
else
response.write"<a href='xianshi.asp?page_no="&I&"'>" &I &"</a > "
end if
next
else
response.write"该记录集为空"
end if
rs.close
set rs=nothing
Conn.close
set Conn=nothing
%>
</body>
</html>
补充:asp教程,ASP入门