General discussion

Locked

AbsolutePage returning -1

By munrrob ·
First may I thank everyone who replied to my last question. I closed it before giving credit but the advice was extremely helpful.

I am now trying to page the results of a search and am using the AbsolutePage property to tell me the page I am on in the recordset.

Unfortunately it is returning -1. The line of code used:

Response.Write "<P>Page: " & RSHits.AbsolutePage & "<P>"

Any ideas?

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

AbsolutePage returning -1

by Glen_McLeod In reply to AbsolutePage returning -1

I'm going to assume you're using ADO.

If your Recordset object is configured as server-side then properties such as AbsolutePage and Recordcount will always return -1. It's because that information isn't sent to the Recordset object, it's kept on the database server. Server-side in ADO refers to the database server and not the IIS server.

Try setting the Recordset's CursorLocation property to adUseClient (or the numeric equivelent).

Glen

Collapse -

AbsolutePage returning -1

by munrrob In reply to AbsolutePage returning -1

Poster rated this answer

Collapse -

AbsolutePage returning -1

by munrrob In reply to AbsolutePage returning -1

Further Info:

I am using ADO to write an ASP page. If I try to set the properties individually using this code:
'Create the recordset object
set RSHits = Server.CreateObject("ADODB.Recordset")
RSHits.CursorType=adOpenStatic
RSHits.CursorLocation=adUseClient
RSHits.ActiveConnection=conn
RSHits.Open SQLString
I get the following error in the browser:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
I return a valid recrdset if I use:
RSHits.open SQLString, conn, 3, 3
but return a -1 when using the ActivePAge property of the recordset.

Collapse -

AbsolutePage returning -1

by munrrob In reply to AbsolutePage returning -1

This question was closed by the author

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums