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