空话不多说,直接进入主题:
叶子分页类v1.2中,190行:
源码:
'此处是为了批改access记录多而且最后一页只有一笔记录则报Eof的bug,弊端就是最后一页会显示2条=___=If iPageIndex > 1 And iPageIndex = iPageCount And (iRecordCount Mod iPageSize = 1) Then
Rs.AbsolutePosition = (iPageIndex - 1) * iPageSize
Else
Rs.AbsolutePosition = (iPageIndex - 1) * iPageSize + 1
End If
此处叶子本人虽举办了修改,但照旧有小小的遗憾,当最后页只有1笔记录时,在显示的时候会显示为两条。
修改:
要领一:利用静态游标(即oConn,1,1改为oConn,3,1)
Set Rs = Server.CreateObject ("Adodb.RecordSet")Rs.Open "SELECT " & sField & " FROM " & sTable & " " & sCondition & " " & sOrderBy,oConn,3,1,&H0001
'此处是为了批改access记录多而且最后一页只有一笔记录则报Eof的bug,弊端就是最后一页会显示2条=___=
Rs.AbsolutePosition = (iPageIndex - 1) * iPageSize + 1
要领二:
Set Rs = Server.CreateObject ("Adodb.RecordSet")Rs.Open "SELECT " & sField & " FROM " & sTable & " " & sCondition & " " & sOrderBy,oConn,1,1,&H0001
'此处是为了批改access记录多而且最后一页只有一笔记录则报Eof的bug,弊端就是最后一页会显示2条=___=
If iPageIndex >1 and iPageIndex = iPageCount Then
Rs.Move (iPageIndex-1) * Clng(iPageSize)
End If
Rs.AbsolutePosition = (iPageIndex - 1) * iPageSize + 1
按以上要领修改后,一切正常。
叶子asp分类页 v0.12下载