Get the App
SLTechnology News&Howtos  ›  Development  › 

How to repair leaf ASP paging class Bug

Shulou Source: shulou.com Published: 2022-06-02 19:36:04 10月03日 Update

This article introduces the relevant knowledge of "how to repair leaf ASP paging class Bug". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1 'this is to correct the bug of Eof if there are many access records and there is only one record on the last page. The disadvantage is that the last page will show 2 = _ _ =

2IfiPageIndex > 1AndiPageIndex=iPageCountAnd (iRecordCountModiPageSize=1) Then

3Rs.AbsolutePositioning = (iPageIndex-1) * iPageSize

4Else

5Rs.AbsolutePositioning = (iPageIndex-1) * iPageSize+1

6EndIf

Method 1: use static cursors (i.e. oConn,1,1 is changed to oConn,3,1) viewsourceprint?1SetRs=Server.CreateObject ("Adodb.RecordSet")

2Rs.Open "SELECT" & sField& "FROM" & sTable& "& sCondition&" & sOrderBy,oConn,3,1,&H0001

3' this is to correct the bug of Eof if there are many access records and there is only one record on the last page. The disadvantage is that 2 entries will be displayed on the last page.

4Rs.AbsolutePosition= (iPageIndex-1) * iPageSize+1

How to repair leaf ASP paging class Bug

Method 2: viewsourceprint?1SetRs=Server.CreateObject ("Adodb.RecordSet")

2Rs.Open "SELECT" & sField& "FROM" & sTable& "& sCondition&" & sOrderBy,oConn,1,1,&H0001

3' this is to correct the bug of Eof if there are many access records and there is only one record on the last page. The disadvantage is that the last page will show 2 = _ _ =

4IfiPageIndex > 1andiPageIndex=iPageCountThen

5Rs.Move (iPageIndex-1) * Clng (iPageSize)

6EndIf

7Rs.AbsolutePositioning = (iPageIndex-1) * iPageSize+1

This is the end of the content of "how to repair the leaf ASP paging class Bug". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Leaves only disadvantages that is content methods more knowledge practicality success in learning and then dilemmas realities situations articles cases cursors ribbons websites industries Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MariaDB NVidia Xiaomi OPPO Reno