Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM question
Message
From
05/10/1999 23:01:42
 
 
To
05/10/1999 16:25:37
Luca Meroni
Easy Consult S.R.L.
Milan, Italy
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00272918
Message ID:
00273044
Views:
29
>I'm trying to develope a COM server than work on a company NT4 server and make on it all the hard work of query.
>I need, however, access to cursor created by the COM server from the client.
>I've read that this is possible using Data Access Objects (DAO).
>Is there someone who can tell me how to do this ? Any example....
>My table are Visual Foxpro tables, we dont use SQL databases.
>
>Thanks, Luca

You probably mean ADO (ActiveX Data OBjects). Returning an ADO recordset from a VFP COM object is pretty straightforward with the new VFPCOM utility. (Actually, it was straightforward before too: boh Rick Strahl and Ken Levy wrote conversion classes in VFP long before VFPCOM was released.)

To do this in your COM server, you need to install the VFPCOM utility on the machine where he COM server runs. Then you create the ADO rs like this:

SELECT * FROM MyTable WHERE SomeField = .T. INTO CURSOR MyCursor

oCOMUTil = CREATEOBJECT("VFPCOM.ComUtil")
oRS = CreateObject("ADODB.Recordset")

oComUtil.CursorToRS(oRS)

RETURN oRS

Then the client app can use the ADO rs.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform