ASP Access Recordset Paging

Y

Yosi

Hi all,

I have access database file with 2 tables,
the tables have the same columns but with different data,
and I have 2 asp files that show the content of each table with paging
recordset,
they have the same code, but only one asp works,
when I try to open the second page i got this 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.

it doesn't make sense how one asp page with the same code working,
and the other not, any idea wht it happend ?

the code:

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.mode = 3
FilePath = "C:\Inetpub\wwwroot\database.mdb"
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & FilePath & ";
Set RS = Server.CreateObject("ADODB.Recordset")
RS.CursorType = adOpenStatic
RS.PageSize = 5
RS.Open "SELECT * FROM table1", Conn
RS.AbsolutePage = cp
rc = 0
While not RS.EOF and rc < RS.PageSize
response.write RS("FirstName") & "<br>"
RS.MoveNext
Wend
RS.Close
SET RS = NOTHING
Conn.close
Set Conn = NOTHING

Many thanks in advance,

Yosi.
 
B

Bob Barrows [MVP]

Yosi said:
Hi all,

I have access database file with 2 tables,
the tables have the same columns but with different data,
and I have 2 asp files that show the content of each table with
paging recordset,
they have the same code, but only one asp works,
when I try to open the second page i got this 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.
it doesn't make sense how one asp page with the same code working,
and the other not, any idea wht it happend ?

Well, there has to be something different ...
the code:

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.mode = 3
FilePath = "C:\Inetpub\wwwroot\database.mdb"
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & FilePath
& ";

Probably nothing to do with your problem but ...
http://www.aspfaq.com/show.asp?id=2126
Set RS = Server.CreateObject("ADODB.Recordset")
RS.CursorType = adOpenStatic

This cursor type should be supporting bookmarks. Verify that the provider
was able to give you this cursor type by checking it after you open the
recordset:

Response.Write RS.CursorType
RS.PageSize = 5
RS.Open "SELECT * FROM table1", Conn

Again, nothing to do with your problem but:
http://www.aspfaq.com/show.asp?id=2096

There seems to be no reason not to use a disconnected client-side cursor
here:

RS.CursorLocation = 3 'adUseClient
RS.PageSize = 5
RS.Open "SELECT * FROM table1",,, Conn, 1
Set RS.ActiveConnection = Nothing
Conn.Close

RS.AbsolutePage = cp
etc.
 
E

e.l.

Hi,

I'm having a different problem, but the same error message (ADODB.Recordset
(0x800A0CB3) ).

I tried what you suggested, to verify that the provider gave me the cursor
type I had written.

So here's what i wrote:
rs.open sqlStr, con, 3,3

and i got cursor type=0, locktype=1.

Why is that? and what can I do about it?
 
B

Bob Barrows [MVP]

e.l. said:
Hi,

I'm having a different problem, but the same error message
(ADODB.Recordset (0x800A0CB3) ).

I tried what you suggested, to verify that the provider gave me the
cursor type I had written.

So here's what i wrote:
rs.open sqlStr, con, 3,3

and i got cursor type=0, locktype=1.

Why is that? and what can I do about it?

We can't answer without seeing:
1. your database type and version
2. your connection string
Here is the key line in the CursorType article in the documentation:
"If a provider does not support the requested cursor type, it may return
another cursor type. "
That is why we need to see your connection string

3. the code used to instantiate your recordset and set its intial
properties
4. it might help to see what is contained in sqlStr
 
E

e.l.

Thanks for the quick reply.

1. I use MS Office Access 2003 (11.8166.8202) SP3

2. The code of my connection to the DB and the RS:

dim SQLstr
set con = server.CreateObject ("adodb.connection")
con.open "provider = microsoft.jet.oledb.4.0; data source = c:\ak\Akel.mdb"

set rs = server.CreateObject ("adodb.recordset")
SQLstr = "SELECT * FROM tblProperty"
rs.Open SQLstr, con, 3,3
 
B

Bob Barrows [MVP]

e.l. said:
Thanks for the quick reply.

1. I use MS Office Access 2003 (11.8166.8202) SP3

2. The code of my connection to the DB and the RS:

dim SQLstr
set con = server.CreateObject ("adodb.connection")
con.open "provider = microsoft.jet.oledb.4.0; data source =
c:\ak\Akel.mdb"

You are not using odbc, so you should have removed those groups from the
crosspost.
set rs = server.CreateObject ("adodb.recordset")
SQLstr = "SELECT * FROM tblProperty"
rs.Open SQLstr, con, 3,3

I haven't used Access in a while and I don't have time to test this,
but, from what I can see, you should be getting a static server-side
cursor with optimistic locking. I really cannot see why the provider is
giving you the default forward-only, read-only cursor. My suggestion
would be to change the cursor location to adUseClient (3) which will
force a static cursor to be opened.

Oh, and make sure all database users have Modify permissions for that ak
folder. If your website uses Anonymous access, then the
IUSR_<machine_name> account needs to be granted that permission.
 
E

e.l.

Thanks a lot! You've been really helpful.

What eventually solved the problem was moving the DB from
C:\akel\akel.mdb
to
D:\akel\akel.mdb

I still don't understand why I didn't have access to disc C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top