Link to home
Start Free TrialLog in
Avatar of dba123
dba123

asked on

Problem with AbsolutePage

For some reason, when sp_Get_SearchResults_sss_PriceOnly is run, the Absolute page works just fine but when sp_Get_SearchResults_sss is run, I get the error :

ADODB.Recordset error '800a0cb3'

Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype


The Code
--------------------

If Request.Form("search") = "1" Then
      If strkeywords = "" Then
            strSQL = "sp_Get_SearchResults_Autos_PriceOnly"
            strSQL = strSQL & " @StartPrice = " & Cdbl(strstartprice) & ","
            strSQL = strSQL & " @EndPrice = " & Cdbl(strendprice)
            response.write strSQL
      else
            strSQL = "sp_Get_SearchResults_Autos"
            strSQL = strSQL & " @Keywords = '" & strkeywords & "',"
            strSQL = strSQL & " @StartPrice = " & Cdbl(strstartprice) & ","
            strSQL = strSQL & " @EndPrice = " & Cdbl(strendprice)
            response.write strSQL
      End If
End If


Here is where the AbsolutePage is called in which the line # of the error is:
---------------------------------------------------------------------------------------

      If Request.QueryString("action") <> "search" Then
            ...some code
      else
                    - This is the code that is called to open the connection and results.  Again, this works fine for the first stored proc
                       and does not cause the AbsolutePage error below
            Query.Open strSQL, objConnection, adOpenStatic, adLockReadOnly, adCmdText
      End If


If NOT Query.EOF Then

                  Query.PageSize = 30
                  '### Note: on initial run of search, intp_sss will be null
                  If intp_sss <> "" Then
                        intp_sss = CInt(intp_sss)
                  Else
                  '### On intial search, sets intp_auto to 1
                        intp_sss = 1
                  End If

                  '### Set the absolutePage so ASP knows what the landing page is before showing the paging links
                  Query.AbsolutePage = intp_sss    - Error is here but this works fine for the first stored proc

... rest of code


Another note.   In my functions.asp include, I have this:
------------------------------------------------------------------

Set objConnection = Server.CreateObject("ADODB.Connection")

objConnection.Open "Provider=sqloledb;Data Source=sss;Initial Catalog=sss;User Id=sss;Password=sss;"
ASKER CERTIFIED SOLUTION
Avatar of Saqib Khan
Saqib Khan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dba123
dba123

ASKER

wow, can you explain to me what this does....I think it worked.
Avatar of dba123

ASKER

also, why when I put Query.PageSize = 10 is my results only showing 8 on page 1 and 1 on page 2 when there are 11 records total if I run the stored proc in Query Analyzer?
Avatar of dba123

ASKER

forget the last question.  But can you explain how the cursor worked...
Well for Paging you need a Special Cursor type/Location to move back and forth of your Database Table. and Above Line Does that Trick.
Avatar of dba123

ASKER

I didn't have to use that before though in one of my other apps.....???
were you doing paging before?
maybe you were using AdopenStatic iwth your Connection Object?
sorry..I mean adUseClient with Connection object
Avatar of dba123

ASKER

no, it was all the same...oh well.