Condividi tramite


Session Object

Creates a custom, user-defined object that manages its own data session.

DEFINE CLASS ClassName1 AS Session

Remarks

You can create this custom, user-defined class only using the DEFINE CLASS command. You can, however, add this object to a form or other container programmatically.

Custom, user-defined classes are classes with properties, events, and methods, but with no visual representation. The same general rules that apply to defining other types of classes apply to defining custom classes. Use the Session object for efficient memory management and to ensure safe behavior of multiple object instances in multi-tiered applications.

See Object-Oriented Programming for additional information about creating custom objects as non-visual classes.

Beginning with Visual FoxPro 7.0, the default values for a Visual FoxPro data session are as follows:

Setting

Value

EXCLUSIVE

ON

SAFETY

OFF

TALK

OFF

The default values for a form with a private data session are as follows:

Setting

Value

EXCLUSIVE

OFF

SAFETY

ON

TALK

ON

A form that uses the default data session, also uses the settings that exist for that session because the session was created before the form.

When the Session object represents a COM Server, all intrinsic properties are treated as private.

See Also

Tasks

How to: Add User-Defined Objects to a Form

Reference

Session Object Properties, Methods, and Events

DEFINE CLASS Command

Commands that Scope to a Data Session

Other Resources

Objects, Collections, and Classes

Object-Oriented Programming