Paging code I wrote

Source: Internet
Author: User
Access test address: http://demo-asp.com/demo/works_list.asp
Basically not limited by the record size, 15 milliseconds (access) of the SQL Stored Procedure in milliseconds or 0 milliseconds
Http://www.joekoe.com/forum_view.asp? Forum_id = 3 & view_id = 54183
<! -- The paging data list process is completely self-original. Please make improvements without correction for piracy -->
<! -- Copy please keep this: author: CUIWL (QQ: 27086712 HOMEPAGE: WWW.DEMO-ASP.COM) -->
<%
Sub works_list (pagesize, nsort, table, field, sqlwhere)
Dim recordcount, pagecount, pageno, I
Recordcount = application ("recordcount" & sqlwhere)
If recordcount = "" then
SQL = "select count (id) from works" & sqlwhere
Set rsw.conn.exe cute (SQL)
Recordcount = rs (0) 'total number of retrieved records
Application ("recordcount" & sqlwhere) = recordcount
End if
Pagecount = (recordcount-1) pagesize) + 1' total pages
Pageno = trim (request ("pageno") 'current page
If isempty (pageno) or not isnumeric (pageno) then
Pageno = 1
Else
Pageno = pageno
End if
If pageno <1 then
Pageno = 1
End if
If pageno * 10> = pagecount * 10 then
Pageno = pagecount
End if

If recordcount> 0 then
Call get_pageid (1,100, pagesize, pageno, table, sqlwhere, pagecount)
End if
Response. write "<table width = '000000'> <tr height = 30> <td width = 50> No. </td> <td width = 100%> file name </td> <td width = 80> Author </td> <td width = 100> creation date </td> </tr>"
I = 0

If dblink = 1 then
SQL = "select top" & pagesize & "" & field & "from" & table & "& sqlwhere
Set rsw.conn.exe cute (SQL)
Else
Cmd. commandtext = "page_list"
Cmd. parameters ("@ pagesize") = pagesize
Cmd. parameters ("@ table") = table
Cmd. parameters ("@ field") = field
Cmd. parameters ("@ sqlwhere") = sqlwhere
Set rs1_cmd.exe cute
End if
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.