Michiel,
If that method were a method of your form class then it would work in both private DS and default DS forms. That's the way I handle SETs that are scoped to the DS. If you look at the HELP DATASESSION topic it shows the SETs that have DS scope.
>At the moment we did the following: We created a method in our oMethod object. This is called InitSet(). In this procedure we have all our usual SET commands. We then call this routine in the BeforeOpenTables event of our dataenviroment of our PrivateDataSession form like this: oMethod.InitSet(THISFORM.DATASESSIONID). At the beginning of our InitSet() method we have the following:
>
>LPARAMETER mDataSessionID
>SET DATASESSION TO mDataSessionID
>
>What about this? Is this the right way to do it? I read the SET DATASESSION help and it said it will switch to the datasession you specified. How do you get back to a GlobalData session (or other datasession which are used)?? Or does VFP return to the global datasession when the form is closed?