While setting up a pagination system, the line defining the
AbsolutePage value is returning HTTP 500 errors.
The abbreviated code is.....
-------< CLIP >-------
set rstemp=conntemp.execute(SQL)
rstemp.PageSize = MaxRecsPage
TotalPages = rstemp.PageCount
rstemp.AbsolutePage = RecSetPage
-------< /CLIP >-------
The variable RecSetPage has an integer value of 2 or 3
Any suggestions please.
.les.
Well, you're not seeing the real errors then.
http://www.aspfaq.com/show.asp?id=2109
Let us know what the real error is :-)
--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Other errors in other ASP application do report with a good level of
debug detail so maybe it is only this Absolutepage error that is
befuddling ASP.????
Given that is maybe the case, and more error detail cannot be produced
by the server, would you perhaps have any other tips.
thanks
.les.
AFAIK you need to have your recordset opening with an explicit client side
cursor in order to get the paging to work. eg.
set rstemp = Server.CreateObject("ADODB.Recordset")
With rstemp
.CursorLocation = 3
.Open SQL, conntemp
End With
--
Dan
Without an error message telling you which line is causing the error, what
has made you zero in on the AbsolutePage line?
What Dan has said is not quite true. A server-side snapshot, dynamic or
keyset cursor will also support bookmarks which sill allow AbsolutePage to
work. The problem of course is that using the wrong cursor typ will cause
ADO to raise an explicit error which will get passed to the browser as long
as the server and client settings allow it to.
The commenting out of the line: rstemp.AbsolutePage makes the error
disappear. Funnily enough, the PageSize line creates no problem....
''rstemp.AbsolutePage = RecSetPage
set rstemp=conntemp.execute(SQL)
rstemp.PageSize = MaxRecsPage
>What Dan has said is not quite true. A server-side snapshot, dynamic or
>keyset cursor will also support bookmarks which sill allow AbsolutePage to
>work. The problem of course is that using the wrong cursor typ will cause
>ADO to raise an explicit error which will get passed to the browser as long
>as the server and client settings allow it to.
Hmmmm. I'm not defining any cursor type at all. Could that be it
maybe.????
.les.
o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
Les Juby les...@anti-spam.iafrica.com
Webpro Internet - - - Prosoft Microsystems
Durban, KwaZulu-Natal, South Africa
P.O.Box 35243, Northway 4065, South Africa
Tel: +27 31 563-8344 Fax: +27 31 564-4928
o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
(you *do* know to take "anti-spam" out the address....?
Hmm, you seem to be attempting to set the page before opening the
recordset. This of course is not allowed. But it SHOULD raise an error
that tells you more than the HTTP 500 error page ...
So, you should be doing this:
set rstemp=createobject("adodb.recordset")
rstemp.cursorlocation=3 'adUseClient
rstemp.open SQL,conntemp,,,1 '1=adCmdText
rstemp.PageSize = MaxRecsPage
rstemp.AbsolutePage = RecSetPage
--
HTH,
Bob Barrows
On Fri, 16 Oct 2009 08:50:45 -0400, "Bob Barrows"
<reb0...@NOyahoo.SPAMcom> wrote:
>Yes. The default cursor type is server-side forward-only, unless you
>specify a client-side cursorlocation (adUseClient) in which case the
>cursor type is always static (adOpenStatic).
>
>Hmm, you seem to be attempting to set the page before opening the
>recordset. This of course is not allowed. But it SHOULD raise an error
>that tells you more than the HTTP 500 error page ...
>
>So, you should be doing this:
>
>set rstemp=createobject("adodb.recordset")
>rstemp.cursorlocation=3 'adUseClient
>rstemp.open SQL,conntemp,,,1 '1=adCmdText
>rstemp.PageSize = MaxRecsPage
>rstemp.AbsolutePage = RecSetPage
Thanks Bob - Right on the money there.
Pagination now working superbly.!
I need a drink.......