Activates the specified form's data session.
Syntax
SET DATASESSION TO [nDataSessionNumber]
Arguments
nDataSessionNumber
Specifies a form's data session to activate. If you omit nDataSessionNumber, data session 1 (the Global data session) is activated.
Remarks
By default, data session 1, the Global data session, is active when you start Visual FoxPro.
A form's DataSession property determines whether the form has its own unique data session when the form is created. If a form's DataSession property is set to true (.T.), the form has its own data session; otherwise, a data session is not created for the form. You can use the form's read-only DataSessionId property to determine the form's data session number.
A data session is closed when the form that created the data session is released.
SET DATASESSION is typically used to debug forms, and should not be issued when a form is active.
The following SET commands scope to the current data session: