Setting the recordset for a form with an ADO command object 
Author Message
 Setting the recordset for a form with an ADO command object

I've in the form_open event, created a recordset from a stored procedure
(access Query) that uses parameters.  Following the documentation, I
appended parameters to the command object and did a .execute.  That worked
fine.  I did return a recordset, and apparently have the right number of
records, etc.

However, when I try to assign this recordset to the current form using:

set Me.recordset = rst

where rst was dim'd as new ADO.recordset, it tells me that I have invalid
properties and won't assign it.

The code I'm using is straight from the help file. Is there another trick
here?  I don't understand...

--Darwin



Fri, 19 Jul 2002 03:00:00 GMT  
 Setting the recordset for a form with an ADO command object
The types of recordsets supported by the form's Recordset property are
somewhat limited. If you are working in an mdb file, you'll find that
you have the most options if you use a DAO recordset rather than an
ADO recordset. If that doesn't help, then you may need to post the
exact code you are using to build the recordset.

 -- Andy


Quote:
>I've in the form_open event, created a recordset from a stored procedure
>(access Query) that uses parameters.  Following the documentation, I
>appended parameters to the command object and did a .execute.  That worked
>fine.  I did return a recordset, and apparently have the right number of
>records, etc.

>However, when I try to assign this recordset to the current form using:

>set Me.recordset = rst

>where rst was dim'd as new ADO.recordset, it tells me that I have invalid
>properties and won't assign it.

>The code I'm using is straight from the help file. Is there another trick
>here?  I don't understand...

>--Darwin



Fri, 19 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

2. Read/Write recordsets from ADO command objects

3. HELP: ADO command and recordset objects

4. recordset and command objects in ADO

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

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

7. Setting the ActiveConnection property of a Command Object (ADO 2.7)

8. ADO recordset: Object variable or with block variable not set

9. Not able to assign an ADO recordset as the recordsource/set of a report or form

10. How to set continuous form to recordset object??

11. how to set recordset clone to second child level recordset in shape command

12. When to use Command object or Recordset object

 

 
Powered by phpBB® Forum Software