DB Paging not working

M

M P

Whats wrong with my code? I have my AccessDB with 1000 records on tblItems.
When I try to write the Pagecount on the screen, it writes "-1". Hope you
might help.

<%
Set conn= Server.CreateObject("ADODB.Connection")
conn.Open "FileDSN=file.dsn"

strSQL = "SELECT * FROM tblItems ORDER BY Category "

strPageSize= 20

Set objPagingRS = Server.CreateObject("ADODB.Recordset")
ObjPagingRS.PageSize = strPageSize
ObjPagingRS.CacheSize = strPageSize
ObjPagingRS.Open strSQL, conn

strPageCount= ObjPagingRS.PageCount


Response.Write "<BR>"
Response.Write "Page Size is " & strPageSize
Response.Write "<BR>"
Response.Write "Page Count is " & strPageCount
Response.Write "<BR>"
Response.Write "Current Page is " & strPageCurrent
Response.Write "<BR>"

..
..
..

%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top