ASP Access Recordset Paging
Question posted by: Yosi
(Guest)
on
August 5th, 2008 11:45 AM
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.
|
|
August 5th, 2008 12:05 PM
# 2
|
Re: ASP Access Recordset Paging
Yosi wrote:
Quote:
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 ...
Quote:
>
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
Quote:
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
Quote:
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.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
|
|
August 25th, 2008 12:55 PM
# 3
|
Re: ASP Access Recordset Paging
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?
|
|
August 25th, 2008 01:15 PM
# 4
|
Re: ASP Access Recordset Paging
e.l. wrote:
Quote:
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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
|
|
August 25th, 2008 01:35 PM
# 5
|
Re: ASP Access Recordset Paging
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
|
|
August 25th, 2008 02:05 PM
# 6
|
Re: ASP Access Recordset Paging
e.l. wrote:
Quote:
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.
Quote:
>
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_nameaccount needs to be granted that permission.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
|
|
August 25th, 2008 03:15 PM
# 7
|
Re: ASP Access Recordset Paging
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.
Not the answer you were looking for? Post your question . . .
189,074 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).
|