Partager via


SET DATASESSION Command

Activates the specified form's data session.

SET DATASESSION TO [nDataSessionNumber]

Parameters

  • 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 typically is used to debug forms. Care should be taken when issuing this command when a form is active, because tables in non-current datasessions are not accessible.

The following SET commands scope to the current data session:

SET Commands

SET ANSI SET AUTOSAVE
SET BLOCKSIZE SET CARRY
SET CENTURY SET COLLATE
SET CONFIRM SET CURRENCY
SET DATABASE SET DATE
SET DECIMALS SET DELETED
SET DELIMITERS SET EXACT
SET EXCLUSIVE SET FIELDS
SET FIXED SET HOURS
SET LOCK SET MARK TO
SET MEMOWIDTH SET MULTILOCKS
SET NEAR SET NULL
SET POINT SET REPROCESS
SET SAFETY SET SECONDS
SET SEPARATOR SET SYSFORMATS
SET TALK SET UNIQUE

See Also

AUSED( ) | CREATE FORM | DataSession Property | DataSessionId Property