How to realize paging display of message records when ADO accesses data
Source: Internet
Author: User
We know: For a guest book, if we only allow the Internet users to see their own messages and can not see other people's messages, then this kind of guest book can only apply to some special places (such as "Customer feedback form" or "complaint message" and so on, because if you are the boss, you will not be willing to your own " Scar "to be opened to the people to see casually." So we have to make every person on the Internet see all the messages in the guest book. In order to improve the reading speed of the page, we will be the message in the guest book into more than one page to display, each page shows a certain number of messages, such as 5.
Speaking of this many, then in the end how to achieve the message record paging display function? If we are clear about the Recordset object of ADO, it is not difficult to achieve it. Because the paging display when ADO accesses a database is the operation of the recordset's records. So before I can explain the procedure, I think it is necessary to give you some information about the Recordset object.
The main ADO objects are three: Connection, command, and Recordset. The connection object is able to establish a connection between data and applications, and the command and Recordset objects are used to request, store, or update data after the connection is established. The Command object acts primarily as a role for database query, and
The Recordset object is the most special and powerful of the three, and the data collection obtained by the data is stored in the recordset, and the returned recordset data collection is then added to the process, analysis, and display data on the client browser via the server-side scripting locale.
A summary of all the internal properties provided by the Recordset object and its functionality is outlined below:
AbsolutePage Property--current absolute data page position
AbsolutePosition Property--current absolute data position
ActiveConnection Property-Active link with connection, command object
BOF Property--opening bounds of dataset
Bookmark Property--Provides bookmark function for cursor position
The amount of memory that the data in the CacheSize property--recordset is temporarily stored
CursorLocation Property--The type of control cursor is server-side or client
CursorType Property--controls how data is retrieved from the server-side database
EOF Property--The end boundary of a recordset
EditMode Property--controls the processing state of the current data
Filter Property-Controls the content of the data that you want to show or hide
LockType attribute--the mode of controlling data update
MaxRecords Property--Maximum number of record rows allowed to be retrieved from the server side
PageCount Properties--Total data pages
PageSize Property--controls the row of records within each data page
RecordCount Property--Total number of record rows retrieved from server side
Source Property--Data query information
Status Property--state or information after the most recent line of data processing
Having learned more about the attributes and methods of the Recordset object, we began to learn how to implement the paging display of the message records. In the following study, the previous chapters have learned the knowledge I will not repeat here, we are only here to learn processing message records paging page2.asp file.
' Call Adovbs.inc file and Message page self2.asp.
'-= The HTML code for the Web page has been omitted here, the content can be downloaded from the source code after viewing =-
Back to Message form ±
Pages:/
' Represents the current page number, representing the total number of data pages.
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