How to return a DAO Recordset from an ActiveX EXE (vb4 16bit) 
Author Message
 How to return a DAO Recordset from an ActiveX EXE (vb4 16bit)

I've been trying to figure this out for a while.
I've got an app. that calls a method of an out of process server that
returns a recordset object e.g.

Server Object
-------------------
Public Function GetMyRecordset(byval sQuery$) as Recordset

Dim recRes as Recordset

    Set recRes = MyDb.OpenRecordset(sQuery)
    set GetMyRecordset = recRes

exit function

I call this object method from within my application in the normal way e.g.

dim resReturnResults as Recordset

    set resReturnResults = objMyObject.GetMyRecordset(sMyQuery)

There is no error generated at either end, the recordset gets created in
the
server, no problem.  But the object doesn't get returned i.e.
resReturnResults
doesn't get instantiated.  I can't figure out what I'm doing wrong!

Any ideas ?

Thanks,
Steve



Fri, 01 Dec 2000 03:00:00 GMT  
 How to return a DAO Recordset from an ActiveX EXE (vb4 16bit)

Have you tried changing from a public function to a public property?  I pass
a fair bit  of info via public properties (haven't tried recordsets yet,
though).

Quote:

>I've been trying to figure this out for a while.
>I've got an app. that calls a method of an out of process server that
>returns a recordset object e.g.

>Server Object
>-------------------
>Public Function GetMyRecordset(byval sQuery$) as Recordset

>Dim recRes as Recordset

>    Set recRes = MyDb.OpenRecordset(sQuery)
>    set GetMyRecordset = recRes

>exit function

>I call this object method from within my application in the normal way e.g.

>dim resReturnResults as Recordset

>    set resReturnResults = objMyObject.GetMyRecordset(sMyQuery)

>There is no error generated at either end, the recordset gets created in
>the
>server, no problem.  But the object doesn't get returned i.e.
>resReturnResults
>doesn't get instantiated.  I can't figure out what I'm doing wrong!

>Any ideas ?

>Thanks,
>Steve



Fri, 01 Dec 2000 03:00:00 GMT  
 How to return a DAO Recordset from an ActiveX EXE (vb4 16bit)

Steve,

I do not use this form to pass data back and forth.
I recall reading and then later testing the following:
Use a Variant type to send and return data instead of Recordset. Once you
receive the Variant variable, then you can cast it (by equating it to) to a
Recordset and manipulate the data you want.

Regards,
Sami.

Newleaf wrote :

Quote:
>I've been trying to figure this out for a while.
>I've got an app. that calls a method of an out of process server that
>returns a recordset object e.g.

>Server Object
>-------------------
>Public Function GetMyRecordset(byval sQuery$) as Recordset

>Dim recRes as Recordset

>    Set recRes = MyDb.OpenRecordset(sQuery)
>    set GetMyRecordset = recRes

>exit function ....



Sun, 03 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help Need to Exe a DOS exe from VB4 and return output

2. DAO 3.0/2.5 and VB4-16bit...?!

3. Using SQL in VB4 16bit and DAO 2.5

4. DAO 3.0/2.5 and VB4-16bit...?!

5. DAO 3.0/2.5 and VB4-16bit...?!

6. out of memory with VB4.0 16bit exe

7. Active X exe from 16bit VB4?

8. How to make 16bit exe for Win3x under VB4/32bit in WinNT4.0

9. VB4 - 16BIT Sheridan Calendar Widgets (16bit OCX)

10. 16bit SourceSafe problems w/VB4.0-16bit - too many file handles open

11. VB3 16bit to VB4 16bit

12. return recordset from fuction; dao

 

 
Powered by phpBB® Forum Software