Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it OK to Set Datasessionid
Message
From
25/06/1999 17:51:49
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00233988
Message ID:
00234234
Views:
19
Hi Chuck,

Actually, there is no problem with using SET DATASESSION in a form's methods as long as the form doesn't have a DataEnvironment - as in a form class.

For example, you can have a business object (with it's own Session, DataEnvironment, Cursors, etc.) and have a form method look something like this:
Method: SetDataSession

LPARAMETERS tnDataSessionID

WITH This
     IF .DataSession = 2 AND VARTYPE(tnDataSessionID) = "N" AND ;
        tnDataSessionID <> .DataSessionID

        SET DATASESSION TO (tnDataSessionID)
        .DataSessionID = tnDataSessionID
        .Refresh()
     ENDIF
ENDWITH
You can swap Biz objects whenever you want. The onlny thing to keep in mind is that the ControlSource for Grids gets wiped out and has to be reset.



>You should never have to use SET DATASESSION in a form's methods. It is as dangerous as they make it sound in the docs.
- Jeff
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform