Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ADODB.Recordset (0x800A0BB9) Error

65 views
Skip to first unread message

Cristina

unread,
Aug 24, 2001, 3:53:04 AM8/24/01
to
Hi!

I have the following code in my web page, that display one
record from a table. My database is in Access 2000 and I
use the ODBC connection.

Set RsP=Server.CreateObject("ADODB.Recordset")
RsP.CursorLocation=adUseClient
Set RsP=Conn.Execute("Select * from Processo")

Iuse this lines of code to help me implement the paging of
the record's...But it gives me a error ADODB.Recordset
(0x800A0BB9) Error in the "RsP.CursorLocation=adUseClient"
and I don't know what is the problem!

Thank's in advance!

Cristina

Michael J. Mooney

unread,
Aug 24, 2001, 12:14:04 PM8/24/01
to
Hi,
Two things:
1) Do you have adUseClient defined anywhere? If you do not, and do not have
"Option Explicit" turned on, the the ASP error will indicate an invalid
value instead of an undefined symbol (the compiler will not know what
adUseClient is, and will try to assign some default value).
2) That line will not do anything anyway. You are setting a property on a
recordset object, and Execute line will replace the existing recordset with
the one returned from the Execute statement. Try:
RsP.CursorLocation= 3
'3 is actual value of adUseClient.
' Some versions of adovbs.inc define adUseClient as 1
' and adUseClientBatch as 3, but you want to use 3 in this case.
Set RsP.ActiveConnection = Conn
RsP.Open "Select * from Processo"

Hope this helps,

--
Michael J. Mooney
MCP+SB, MCSD


"Cristina" <cristina...@ag3net.pt> wrote in message
news:16f8801c12c71$ce2655f0$b1e62ecf@tkmsftngxa04...

Irene Smith

unread,
Aug 24, 2001, 1:42:58 PM8/24/01
to
There are several things which could be causing your
problem, but the most likely is that you have not
included the file that defines the ADO constants.
Therefore, you are setting cursor location to 0 and that
is not a valid value for the CursorLocation property. In
order to define this constant, you need to use one of the
following lines at the beginning of the page:

<!-- #Include file="ADOVBS.INC" -->

OR

<%' use this meta tag instead of adovbs.inc%>
<!--METADATA TYPE="typelib" uuid="00000205-0000-0010-8000-
00AA006D2EA4" -->

The first is a reference to an include file that defines
ADO constants. Of course you will also need to make sure
this file is located in a directory that is accessible to
your web page. The default location for this file
is: "c:\Program Files\Common Files\System\ado\" and you
can copy it from there into your web site's directory.

The second line (which should be all one line) creates a
direct reference to the ADO libraries.

If you execute the next line after the one that sets the
cursor location, you will have another error as well. The
Recordset object does not have an Execute method. You
need to use code more like this:

<%' Set reference to ADO library %>
<!--METADATA TYPE="typelib" uuid="00000205-0000-0010-8000-
00AA006D2EA4" -->

Dim strCnxn
Dim strSQLSelect

' Change the connection string as appropriate for
' your database, of course.
strCnxn = "Provider=MSDASQL;DSN=ProcessoDsn"
strSQLSelect = "SELECT * FROM PROCESSO"

Set rsP = Server.CreateObject("ADODB.Recordset")
rsP.CursorLocation = adUseClient
rsP.CursorType = adOpenStatic
rsP.LockType = adLockReadOnly
rsP.Open strSQLSelect, strCnxn

Now everything should be all right. However, if you are
going to display a single row, it might be more efficient
to change the select statement to limit the results of
the query to the proper row by adding a WHERE clause
like "WHERE CustomerID=12345" and use a field list
instead of the asterisk (*) as in, "SELECT Name, Address,
Phone FROM People" to limit the amount of data that has
to be passed from the Access database to your web server.

This posting is provided "AS IS" with no warranties, and
confers no rights. You assume all risk for your use. ©
2001 Microsoft Corporation. All rights reserved.

Irene Smith

>.
>

Michael J. Mooney

unread,
Aug 24, 2001, 1:57:08 PM8/24/01
to

"Irene Smith" <ism...@microsoft.com> wrote in message
news:11edb01c12cc4$36d07d90$a4e62ecf@tkmsftngxa06...
<...>

> This posting is provided "AS IS" with no warranties, and
> confers no rights. You assume all risk for your use. ©
> 2001 Microsoft Corporation. All rights reserved.
>
> Irene Smith

Do you work for Microsoft?


Irene Smith

unread,
Aug 24, 2001, 2:40:10 PM8/24/01
to
Yes. I am a Programmer/Writer for MDAC (Microsoft Data
Access Components) User Education.

>.
>

Irene Smith

unread,
Aug 24, 2001, 2:40:05 PM8/24/01
to
Yes. I am a Programmer/Writer for MDAC (Microsoft Data
Access Components) User Education.

>-----Original Message-----
>

>.
>

0 new messages