>Why are are fixated on the COM Server having access to the calling process's private datasession is beyond me.
We are so fixated on it because that's what VFPCOM does. It does not USE the table, it just sees the one that is open in the current datasession of the VFP process that called it. This is not everyday COM stuff.
This thread originated with "how does VFPCOM do that?". This question was asked so that the asker could write some functionality similar to that, and so far, the question has not been answered.
>That is the most basic I can make the scenario....
Except that the scenario you have presented does not address the question. Try this to make it even simpler:
DEFINE CLASS TestCOM AS Custom OLEPUBLIC
FUNCTION GetRecCount
LPARA tcAlias
SELECT (tcAlias)
RETURN RECCOUNT()
ENDDEFINE
Compile this into a COM server, and call it from VFP's command window:
USE c:\SomeTable ALIAS SomeTable
oTC = CREATEOBJECT("TestCom.TestCom")
lnRecCount = oTC.GetRecCount("SomeTable")
?lnRecCount
It doesn't work, because Datasession information does not cross COM boundaries, but somehow with VFPCOM, it does. That's the question.
Erik Moore
Clientelligence