Read/Write recordsets from ADO command objects 
Author Message
 Read/Write recordsets from ADO command objects

I have so far failed miserably to get ADO (Vs 2.1 & 2.5) to open recordset
in update mode based on a query with 1 or more parameters

From what I can make out from the documentation, this is, in fact,
impossible because parameters require the use of a command object and
recordsets produced using a command object are inherently read only.

Does anyone out there know whether this is the case or what the work round
is...if there is one?

Using DAO, we used to update recordsets produced from parametised queries
(assuming that the joins were inner) regularly and I find it hard to believe
that MS have made this useful feature impossible to implement in ADO.

Cheers

Paul BJ



Wed, 18 Jun 1902 08:00:00 GMT  
 Read/Write recordsets from ADO command objects
Hi Paul,

Try something like

  dim rst as adodb.recordset
  dim sqlstr as string
  dim connAccess as new adodb.connection

  connaccess.connectstring = "A Valid Connection String to An Access
Database"

  set rst = new adodb.recordset
  sqlstr = "Select * from MyTable where [Field1] = 100"
  rst.open sqlstr, connAccess, (Some other options I always forget the
order of), adcmdtext

  '  Now with the correct options on the open you should be able to edit
you recordset.

  'When you are done close the objects and set them to nothing.
  rst.close
  connaccess.close
  set rst = nothing
  set connaccess = nothing

HTH

--
-Dick Christoph

http://www1.minn.net/~dchristo

Quote:

> I have so far failed miserably to get ADO (Vs 2.1 & 2.5) to open recordset
> in update mode based on a query with 1 or more parameters

> From what I can make out from the documentation, this is, in fact,
> impossible because parameters require the use of a command object and
> recordsets produced using a command object are inherently read only.

> Does anyone out there know whether this is the case or what the work round
> is...if there is one?

> Using DAO, we used to update recordsets produced from parametised queries
> (assuming that the joins were inner) regularly and I find it hard to believe
> that MS have made this useful feature impossible to implement in ADO.

> Cheers

> Paul BJ



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADO: Read And Write Recordset with Command.Execute

2. Recordset of a command object is always read-only (ADO, VC++)

3. ADO Read-write parameter query recordsets

4. ADO Read-write parameter query recordsets

5. The resulting recordset of a command object execution is always read-only

6. Setting the recordset for a form with an ADO command object

7. Passing variables to an ADO Command or RecordSet Object in another frame

8. HELP: ADO command and recordset objects

9. recordset and command objects in ADO

10. ADO, Oracle, MTS, using command object to open Recordset

11. When to use Command object or Recordset object

12. ADO Command object and MSShape commands

 

 
Powered by phpBB® Forum Software