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
Hope this helps,
--
Michael J. Mooney
MCP+SB, MCSD
"Cristina" <cristina...@ag3net.pt> wrote in message
news:16f8801c12c71$ce2655f0$b1e62ecf@tkmsftngxa04...
<!-- #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
>.
>
Do you work for Microsoft?
>.
>
>-----Original Message-----
>
>.
>