Solved

Trying to Implement paging in classic asp.ADODB.Recordset error '800a0cb3' ,Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.

Posted on 2006-06-15
3
705 Views
Last Modified: 2008-02-01
Trying to Implement paging in classic asp.

Its gives me error that is below.

ADODB.Recordset error '800a0cb3' ,Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.

Here is my code.

Set rs= Server.CreateObject("ADODB.Recordset")
            
            
rs.CursorLocation = 3      'adUseClient
rs.CursorType = 3            'adOpenStatic

FormCmdObject "Sp_name"      '' FormCmdObject is a sub in my page which forms the command object                  
AddParameters cmd, "param1", advarchar, 10, m_val1 '' AddParameters is a sub which collects param
AddParameters cmd, "@param2", advarchar, 4000, val2
Set rs = cmd.Execute


            rs.PageSize = iPageSize
            rs.CacheSize = iPageSize


            iPageCount = rs.PageCount
            iFieldCount = rs.Fields.Count
            iRecordCount = rs.RecordCount

            If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
            If iPageCurrent < 1 Then iPageCurrent = 1

iRecordCount = iRecordCount - 1
iFieldCount  = iFieldCount - 1
LoopRecordCount = LoopRecordCount - 1

pageNum = Round(iRecordCount/iPageSize)
If pageNum < (iRecordCount/iPageSize) Then pageNum = pageNum + 1

If iPageCurrent = 1 Then      
      intPageNum =  pageNum
else      
      intPageNum =  iPageCurrent-1
end if

If iPageCurrent = pageNum Then      
      intPage = pageNum
else      
      intPage =  iPageCurrent+1
end if  

Please help.

Thanks.


0
Comment
Question by:r_pat72
  • 2
3 Comments
 
LVL 14

Expert Comment

by:CyrexCore2k
ID: 16915966
Try changing the cursor type to adOpenDynamic (Integer Value: 2) and see if that works.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 16917247
Unfortunately the questioner is using the Command object's Execute method to create the recordset so they cannot change anything.  For performance reasons, the only output available from the Execute method is a firehose (forward-only/read-only) cursor.

What they can do is change the method of opening the recordset to use the Recordset's Open method and use the Command object as the Source.  In that case they can define the CursorType as well as all other Recordset properties.
0
 
LVL 14

Accepted Solution

by:
CyrexCore2k earned 500 total points
ID: 16921118
Oh good call ac, I didn't really read his code

r_pat Do the following:
'----- BEGIN CODE -------
Set rs= Server.CreateObject("ADODB.Recordset")
         
rs.CursorLocation = 3     'adUseClient
rs.CursorType = 2          'adOpenDynamic

FormCmdObject "Sp_name"     '' FormCmdObject is a sub in my page which forms the command object              
AddParameters cmd, "param1", advarchar, 10, m_val1 '' AddParameters is a sub which collects param
AddParameters cmd, "@param2", advarchar, 4000, val2
rs.Open cmd
'----- END CODE -----------

and see if that fixes the problem.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now