Asp + sqlserver paging method (no stored procedure required)
Source: Internet
Author: User
My asp + sqlserver paging program: This program is characterized by dropping the current page record to the page. The performance is good, and there is no need to store stored procedures. Because the code is not encapsulated, it is scattered. To use it in your program, you need to simply read it first. Then pay attention to the meaning of the places you need to set. Some of them can be omitted. Some parameter passing can also be omitted.
The code is as follows:
'''' Selei's snow paging tool (SQL server) does not need stored procedures -------------------------
'In the annotations, ### must be set by the user.
'Parameter passing ** is required in the annotation.
'Define variables
Dim tOption 'query condition
Dim tOrder 'sort string
The dim tOrderField 'sorting field can be obtained through the parameter: order_field
The dim tOrderDirection 'sorting direction can be obtained through the parameter: order_direction
Dim tPageSize 'page size
Dim tTotalCount 'total number of records can be obtained through the parameter: t_count
Dim tPageCount 'page
The current page number of dim tCurPage can be obtained through the parameter: page
Dim ttablename' table or View Name
Dim tFieldAlias
List of fields queried by dim tFieldList
Dim tPageField field used for paging fields
Number of records retrieved by dim r_count
Set rs = server. createobject ("adodb. recordset") 'record set object
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