pro_vb thread: ADO Recordsets--command.Execute vs. recordset.Open (was: ADO erro-r)
I spent a fair amount of last week beating my head against this exact
thing--two recordsets, defined identically (using the Jet 4.0 provider)
except that in one case I used a Command object & in the other I didn't.
When I got back two very different cursors, I figured I had to be doing
something wrong until I stumbled on the article "Migrating from DAO to ADO",
which says:
Like DAO, ADO Recordset objects can be opened from several
different objects. In ADO, a Recordset can be opened with
the Connection object Execute method, the Command object
Execute method, or the Recordset object Open method. ADO
Recordset objects cannot be opened directly from Table,
Procedure, or View objects. ADO Recordset objects opened
with the Execute method are always forward-only, read-only
recordsets. If you need to be able to scroll or update
data within the Recordset you must use the Recordset
object Open method.
(Read the article in full at:
http://www.microsoft.com/data/ado/adotechinfo/dao2ado.htm)
So can anybody tell me why the Command class has .CursorType and .LockType
properties if they have no effect? Maybe providers other than Jet actually
use them?
Thanks!
-Roy
-----Original Message-----
From: James Texter [mailto:texter@o...]
Sent: Monday, June 19, 2000 2:18 PM
To: professional vb
Subject: [pro_vb] RE: ADO error
Dean,
Well, I wish I had the luxury of a real database, but unfortunately I'm
stuck using Microsoft Access. I managed to get around the problem. What I
was doing was using a command, setting the sql statment as the CommandText,
and then using "Set recordset = command.Execute" method. However, I changed
to just a straight recordset, and it worked fine. Thanks for the help
though!
James
----- Original Message -----
From: M. Dean Parkinson <deanparkinson@e...>
To: professional vb <pro_vb@p...>
Sent: Monday, June 19, 2000 11:38 AM
Subject: [pro_vb] RE: ADO error
> K - just read the original message again. It is ADO. I am assuming that
> you are using a real database like SQL Server or Oracle. Look to see if
you
> are using a client-side or server-side cursor. This was causing that
error
> for us a while back.
>
> Dean