>I need to create a private data session in code. We have a program module that opens all the tables and then does a lot of up front work and before running a form. I just found out that you can only open a new data session from within a form. At least that is all I can find. Is this right?
John,
If VFP6 SP3 or later you could use Session object.
If prior :
-If would be followed by a particular form you could still do it in form.load.
-You could define a form class with private datasession and :
oForm =createobject('PrivateSession')
lnSessId = set('datasession')
set datasession to oForm.DatasessionID
set datasession to lnSessId
oForm.release
define class PrivateSession as Form
Datasession = 2
enddefine
Cetin