Discussion Locked

Page through recorset from ASP

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

I am able to display recordset page wise if I use select statement within ASP page. I tried using the same code when I get recordset through stored procedure I get following error for pagecount, absolutepage etc.. recordset properties.

ADODB.Recordset error '800a0cb3'

The operation requested by the application is not supported by the provider.

Can u please answer my question?

7 replies

by crshnbrn

Check: http://www.asp101.com/samples/db_paging.asp

This is a good site that gives many examples of how to work in ASP. One of the problems that I ran into with ASP is using Record Count and trying to move back in a record. ASP opens recordsets by default with a forward-only cursor. The forward-only cursor only supports the MoveNext function and does not support paging, MoveLast, RecordCount, etc. and will return -1 if these functions are colled. I tried many times to open the recordset with adOpenStatic and adOpenKeyset but it still opened with a Forward only cursor. The reason: adOpenStatic and adOpenKeyset were not defined in ASP and defaulted to 0. Which is the value for the forward-only cursor. Here is the code that I used to open correctly:

Dim Conn 'ADO Connection

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

Conn.Open "Data Source=" & Server.Mappath("dbase.mdb") & ";Provider=Microsoft.Jet.OLEDB.4.0;" ' For MS Access 2000

Dim adOpenStatic, adOpenKeyset
adOpenStatic = 3
adOpenKeySet = 1
Dim SQL

SQL = "SELECT * FROM WebAdmin;"

Set rstWeb = Server.CreateObject("ADODB.RecordSet")
rstWebAdmin.Open SQL, Conn, adOpenKeyset

by bpandit

Hi..

I got email notification for an answer but I can't see the answer .. can u please guide me for this?

This discussion is closed to new replies.