This article describes how to use ASP to display data records in Oracle.
I. Introduction
Pagination is required when you access a table with a large amount of data through a browser. ASP can display database records by page through the ADO object set Recordset object. Recordset has the following attributes for pagination:
PageSize: the number of records displayed on each page.
PageCount: the system automatically calculates the total number of pages based on the user-defined PageSize and the total number of records in the table. RecordCount: Total number of records in the table.
AbsolutePage: indicates the current page number. If the attribute AbsolutePage is set to 3, the current record is moved to 3rd (that is, 1st records) on page 1 ).
After knowing that Recordset has these attributes, I believe that it is very easy to display records by page. Open the database and table, set PageSize and AbsolutePage, and output the recorded data to the browser. It is true that Access or SQL server is used as a database, because both databases support the Recordset attributes for paging. Compared with Access or SQL server, Oracle databases provide better security and superior performance when the data volume is large. However, Oracle does not support these paging attributes. This article introduces a method to display Oracle data records by page using ASP, so that Oracle users can easily display records by page.
II. Implementation Process Analysis
1. Create a Data source:
Install the Oracle client software and use the microsoft odbc for oracle driver to create a DSN such as "DSN = servername; UID = user; PWD = password ".
2. Create a data table:
The simple structure of the personal data table is as follows (the table name is data ):
Data: name, Varchar2; telephone, Number; email, Varchar2;
| [Content navigation] |
| Page 1st: use ASP to display Oracle data records by PAGE |
Page 2nd: use ASP to display Oracle data records by PAGE |