Hey folks, I am trying to do some recordset paging and am at my wits end. I have done heaps of research looking for a solution myself but no joy, I am sure someone here will be know the problem.
I have the following ASP code
This produces the following output
Can anyone explain why pagecount = -1? It should be 3, right? 6 records with a page size of 2.
Nothing I have tried gets it right and if I can't get the pagecount right paging won't work. I have tried different cursors, and so many different things I am now starting to get muddled.
Suggestions please and heaps of thanks in advance.
Steve Davis
NOTE: This sig does not include any reference to voting, stars, or marking posts as helpful as doing so is cause for membership termination.
I have the following ASP code
Code:
rsMail.source = "SELECT count(*) FROM email WHERE recipientID = '" & session("ID") & "' AND delete_flag <> '" & session("ID") & "' AND folder='inbox';"
rsMail.CursorLocation = adUseClient
rsMail.open()
response.write("total records = " & rsMail.fields(0) & "<br><br>")
rsMail.close()
rsMail.source = "SELECT email.*, members.* FROM email INNER JOIN members ON email.senderID = members.id WHERE recipientID = '" & session("ID") & "' AND delete_flag <> '" & session("ID") & "' AND folder='inbox' order by emailID;"
response.write rsMail.source
'response.end
'Set properties for recordset paging
rsMail.CursorLocation = adUseClient
rsMail.PageSize = 2
rsMail.Open()
response.write ("<br><br> page count = " & rsMail.pagecount)
This produces the following output
Code:
total records = 6
SELECT email.*, members.* FROM email INNER JOIN members ON email.senderID = members.id WHERE recipientID = '12439' AND delete_flag <> '12439' AND folder='inbox' order by emailID;
page count = -1
Nothing I have tried gets it right and if I can't get the pagecount right paging won't work. I have tried different cursors, and so many different things I am now starting to get muddled.
Suggestions please and heaps of thanks in advance.
Steve Davis
NOTE: This sig does not include any reference to voting, stars, or marking posts as helpful as doing so is cause for membership termination.