5

I have this ASP classic code that will return a set of records (recordset):

adoRs.Open "EXEC SP_SelectFromTable", adocn, 1

Its obviously from a Stored Procedure source. Now I use a AbsolutePage property for pagination function but it cause an error:

Error Type: ADODB.Recordset (0x800A0CB3) Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.

But when I changed it to a simple select statement like below. It work just fine.

adoRs.Open "SELECT * FROM tblSample", adocn, 1

Any concept I'm missing?

Stuart
  • 711
  • 1
  • 11
  • 35
  • Maybe you are missing some concept... maybe you are aware of cursor types, maybe not... that a look at this for an introduction on cursor types : http://www.w3schools.com/ado/prop_rs_cursortype.asp (do not be fooled by 'client cursor types' in a web app the client is the web app. – Paul Jan 27 '14 at 22:40
  • Have you tried working with ADO command object? Sample code can be found here: http://classical-asp.blogspot.co.il/2010/09/executing-store-procedure-by-ado.html – Shadow The GPT Wizard Jan 28 '14 at 07:57

2 Answers2

8

When I first started working with ADO in ASP I ad the same problem. Most of the easy to find documentation mentions setting the cursor type of the recordset object. But on our servers, I actually have to set it on my connection object to get it to work (never really figured out why).

So on my applications I set it on my connection object like this:

adocn.CursorLocation = adUseClient

Then I can set my recordset as:

adoRs.CursorType = adOpenStatic
Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
Gary Richter
  • 526
  • 4
  • 16
  • Work just fine but instead of using `adUseClient` & `adOpenStatic`, I used 3 & 3 respectively for their counter part because I'm resulting to a "Variable Undefine" error. Thanks! – Stuart Jan 28 '14 at 10:20
  • Most welcome. Here is an additional tidbit on using named constants instead of numeric values: http://www.4guysfromrolla.com/webtech/faq/Beginner/faq7.shtml – Gary Richter Jan 28 '14 at 19:52
  • @Stuart you were getting the variable undefined error because you were't using a document that creates the named constants "adUseClient" and "adOpenStatic" respectively. So in your case yes, you need to use the constant values instead of names. You can get that document at the following URL, just save it to a doc (in this example they are naming it ADOVBS.inc) and #INCLUDE it into your project. Then you can use the constant names instead if prefered ( http://www.4guysfromrolla.com/webtech/faq/Beginner/faq7.shtml ) – Gary Richter May 31 '19 at 14:07
0

Once the recordset is opened the datatype of Bookmark will be changed to either Double or Integer according to the recordcount. Just assign the record number in the variable of that type then it will work fine...

Note:-To know type of bookmark use typename(rs.bookmark) after recordset is opened

Ansari
  • 1