ASP Application Example-pagination _ Code Section

Source: Internet
Author: User
<%
Dim conn,rs,sqlstr,pagesize,rowcount,totalpages,pageno,position,pagebegin,pageend
Set conn= Server.CreateObject ("ADODB.") Connection ")
Set RS = Server.CreateObject ("ADODB.") RecordSet ")
Conn.Open "Provider=sqloledb;data source=127.0.0.1;user id=sa;password=;initial catalog=zjydata"
Sqlstr= "SELECT * from Items ORDER by IID"
Rs.Open sqlstr,conn,1,1
pagesize=10
If RS. Recordcount=0 Then
%>
<table width=100% border=0 cellpadding=1 cellspacing=1 style= ' font-size:9pt ' >
<tr bgcolor= #003366 height=20px>
&LT;TD align=center><font color= #FFFFFF > Product Code </font></TD>
&LT;TD align=center><font color= #FFFFFF > Product name </font></TD>
&LT;TD Align=center><font color= #FFFFFF > Model Specification </font></TD>
&LT;TD align=center><font color= #FFFFFF > Measurement Unit </font></TD>
&LT;TD align=center><font color= #FFFFFF > Reference Price </font></TD>
&LT;TD align=center><font color= #FFFFFF > Reference Price </font></TD>
&LT;TD Align=center><font color= #FFFFFF > Notes </font>
</TR>
<tr height=20px>
&LT;TD Align=center> does not have any merchandise information!</td>
<TR>
</TABLE>
<%
Else
Rs. PageSize = Cint (PageSize)
Totalpages=rs. PageCount
Pageno=request.querystring ("PageNo")
If pageno= "" or pageno<1 Then
PageNo = 1

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.