100,000 Access data Table Paging two solutions _ Application Tips

Source: Internet
Author: User
The way I use it is to load 20 records per page, the looping write is displayed in the table, and then the four-page key is used to view the data, but the problem is that although there are only 20 records per loading page, it is slow to load all the records at a time when you want to open the recordset.
Workaround One:

1. Set up a self-growing field. And this is the index.
2. Because it is ACCESS, it can only be a foreground paging. The purpose of the growth field is to achieve paging functionality.
1> records the last increment of the user's previous page, for example, M.
2> the next page to remove the starting value of a page. M+1, End value: m+1+1.5*pagesize (note: Since the database will have additions and deletions, it should take a page size should have a factor, you can set a 1 based on the circumstances of the coefficient.
3> Front loop takes RS's front PAGESIZE bar, writes it to a new RS, and returns.
Note: The new RS is a connectionless Rs.
Workaround Two:

100,000 records are not the limit of an Access database. What's more, your approach is not really a paging (you should take advantage of the PageSize and AbsolutePage attributes).
VBScript Code

Copy Code code as follows:

Set rs = New ADODB. Recordset
Rs. CursorLocation = adUseClient
Rs. PageSize = 20
Rs. Open "SELECT * from Guest", Iconc, adOpenKeyset, ADLOCKOPTIMISTICLNG
Pages = Rs. PageCount
Lngcurrentpage = 1



There are only 20 records open in the recordset at this time.

When turning the page:

Copy Code code as follows:

If Lngcurrentpage < Lngpages Then
Lngcurrentpage = lngcurrentpage + 1
Rs. AbsolutePage = Lngcurrentpage
End 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.