ASP Paging Code

Source: Internet
Author: User

This is a simple ASP page display code and in the form of ASP page display source code to provide to everyone,

The code is as follows Copy Code

<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Untitled Document </title>

<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 but not Rs. Eof and I>0
I=i-1
Response.Write RS ("username") & "Say to You:" &rs ("word") & "<br>"
Rs. MoveNext
Loop
Response.Write "Please select a data page:"
For I=1 to Rs.pagecount
If I=page_no Then
Response.Write I & "&AMP;NBSP"
Else
Response.Write "<a href= ' xianshi.asp?page_no=" &I& "' >" &i & "</a >&nbsp"
End If
Next
Else
Response.Write "This Recordset is empty"
End If
Rs.close
Set rs=nothing
Conn.close
Set conn=nothing
%>
</body>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.