Two solutions to pagination of 100,000 Access data tables

Source: Internet
Author: User
This article mainly introduces two specific solutions for Acess data table paging. For details, refer to the following. The backend database uses Access. After one year, the user said that the interface was very slow. After checking the database, he found that more than 50 thousand records exist in the data table. He tried to copy the records to 0.1 million, opening the interface is very slow, and turning pages is also a problem.

This article mainly introduces two specific solutions for Acess data table paging. For details, refer to the following. The backend database uses Access. After one year, the user said that the interface was very slow. After checking the database, he found that more than 50 thousand records exist in the data table. He tried to copy the records to 0.1 million, opening the interface is very slow, and turning pages is also a problem.

This article mainly introduces two specific solutions for Acess data table paging. For details, refer to the following.

The backend database uses Access. After one year, the user said that the interface was very slow. After checking the database, he found that more than 50 thousand records exist in the data table. He tried to copy the records to 0.1 million, the interface is very slow, and page turning is the same problem. I am using 20 records on each page, which are displayed cyclically in the table, and then set four page turning keys to view data, however, the problem is that although there are only 20 records loaded into the page each time, it is only slow to load all records at a time when the record set is to be opened.

Solution 1:

1. Set an auto-increment field. The field is INDEX.

2. Because it is ACCESS, it can only be the front page. The purpose of Self-increasing fields is to implement the paging function.

1> record the last auto-increment value on the previous page of the user, for example, M.

2> next page, which is the start value of the next page. M + 1, end value: M + 1 + 1.5 * PAGESIZE (Note: Due to the addition and deletion operations on the database, the page size should have a coefficient, you can customize a coefficient as needed.

3> the front-end cyclically retrieves the front PAGESIZE of RS, writes it to a new RS, and returns the result.

Note: The new RS is a connectionless RS.

Solution 2:

100,000 records are not the limit of the Access database. What's more, your method is not actually paging (the PageSize and AbsolutePage attributes should be used ).

VBScript code

Set rs = New ADODB. Recordsetrs. CursorLocation = adUseClientrs. PageSize = 20rs. Open "Select * From customer", iConc, adOpenKeyset, adLockOptimisticlngPages = rs. PageCountlngCurrentPage = 1

At this time, only 20 records are opened in the record set.

Page turning:

VBScript code

If lngCurrentPage <lngPages Then lngCurrentPage = lngCurrentPage + 1 rs. AbsolutePage = lngCurrentPageEnd If

,

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.