Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Environment vs Data Session
Message
From
20/08/1997 13:16:08
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, United States
 
 
To
20/08/1997 13:02:03
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00045878
Message ID:
00045884
Views:
32
>Hi,
>
>If this question doesn't convince you that I am pretty new to VFP, nothing
>will.
>
>Can some please explain to me the difference, if any, between a data
>session and the data environment? Thanks.
>
>
>Gary J. Sibio

A datasession is like a container. It contains a data environment (explained below). You can have multiple data sessions open using multiple forms and each data session cannot see the other. IOW, you can open the same table, using the same alias, in multiple sessions and each instance of the table can have the pointer at a different record. No instance of the table affects another. It really eliminates some of the funky/creative ways we've had to use aliases in the past.

A Form can use either the default datasession (1) or a private datasession (property DataSession = 2). It's called private only because it's distinct from the default session. If the form is still in memory (not released) then its private data session (if defined) is available elsewhere, either by issuing a SET DATASESSION TO or by setting another form's DataSessionID to the DataSessionID of the form that created the datasession. (I hope that wasn't too garbled, read it twice, that's what I did...lol)

A Data Environment is how to describe the way the data is available to you. It is the tables that are open(used), their aliases, indices and any relations that are defined. In the form designer, when you set DataSession = 2, you can define the Data Environment for the datasession that gets created when you call the form. As mentioned above, this data environment is distinct from the data environment that exists in the default data session.

HTH
Matt McDonnell
...building a better mousetrap with moldy cheese...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform