Click to See Complete Forum and Search --> : Paging - "[-1 Records]" - WHY?


sanjuT
12-10-2004, 11:32 AM
has anyone ever had this error when trying to implement paging?

it's not really an error (no error page) but that is what is returned, when in fact there should be page numbers.

i.e. "1 2 3 4 Next [4 Pages; 70 Records ]"

but i get:


"[-1 Records]"

I can post code if necessary. i just thought this might be a common problem, and someone would know what i did wrong just from the "[-1 Records]" part.

THANKS!

OH YEAH, i am altering the paging code from one page (where it works) and trying to use it in another page. I think i have made all the necessary changes, but then again, that might be the problem.

russell
12-10-2004, 01:04 PM
can't tell without seeing your code. but if you are using the RecordCount property, then yeah, it probably returns -1 if you aren't doing it right.
what db provider?

heavenly_blue
12-10-2004, 04:09 PM
i had the same problem once - perhaps you need to check your cursor type and location?

sanjuT
12-10-2004, 04:16 PM
rsComments.CursorLocation = 3

this is what i have, i cut and pasted from another file.

not sure what to do. i'll wait for the dba to return on monday.

buntine
12-10-2004, 08:09 PM
RecordCount will always return -1 unless your using the correct cursorType. (which is 3, i think)

Regards.

sanjuT
12-13-2004, 10:41 AM
Thanks all! it works now......

BUT..

i am trying to totally have a reuseable include for paging.

i am not sure if i can, cause i realize i need the variable, rsPaging (which i am using now), on the actual page so i can return results into a table.

does anyone know if people do use a paging include in their pages?

i want to make sure i am at least on the right track.

russell
12-13-2004, 01:01 PM
does anyone know if people do use a paging include in their pages?

Absolutely. In fact, that's exactly how you should do it. Keep the pageSize and AbsolutePage as page level variables. Put the code that gets the data in a function in your include file, and call it from wherever you need to, passing the page size and page number to the function.

sanjuT
12-13-2004, 01:39 PM
i am working on it now.

i am finding that i still need to include a lot of paging specific code on the actual page (ie when returning records). this is normal?

russell
12-13-2004, 02:04 PM
Depends on what you are doing. You will need hardly any page-specific code if you return an array via the ADO GetRows method.

sanjuT
12-13-2004, 02:13 PM
thanks, i'll look that up.