Asp + oracle paging method (no stored procedure required)
Source: Internet
Author: User
The paging program used to query oracle databases in asp does not use stored procedures, and the efficiency is acceptable.
The code is as follows:
'''' The snow paging tool of Sebei (oracle) 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
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
'Sorting
TOrderField = Request ("order_field") 'to obtain the sorting field (parameter transfer **)
TOrderDirection = Request ("order_dir") 'to obtain the sorting direction (passing parameters **)
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