Partager via


DataSessionID Property

Returns the data session ID that identifies the private data session for the object. Read-only at design time; read/write at run time.

If the DataSession property of the object is set to 1 (Default Data Session), returns the default data session ID.

Object.DataSessionID

Remarks

Applies To: Form Object | FormSet Object | _SCREEN System Variable | Session Object | ToolBar Object

Available only if the DataSession property of the object is set to 2 (Private data session).

You can use SET DATASESSION with the DataSessionID property to change data sessions.

When you set DataSessionID, the setting affects the working data session for the object. The DataSessionID property setting does not affect objects you create by using CREATEOBJECT( ).

Changing the DataSessionID property setting increments the reference count of the data session changed to and decrements the reference count of the data session changed from. However, if you create a data session by setting the DataSession property to 2 (Private data session), changing the DataSessionID property setting does not release the initial data session. In such case, the object must be released to free the initial session.

For more information on multiple data sessions, see Programming for Shared Access.

Warning

Changing the DataSessionID property setting of an object that contains data-bound controls causes the controls to lose their original data sources. In general, use DataSessionID on objects that do not contain data-bound controls.

See Also

Reference

CREATEOBJECT( ) Function

DataSession Property

SET DATASESSION Command

Other Resources

Properties (Visual FoxPro)

Language Reference (Visual FoxPro)