>>Hi!
>>
>>What is the exact "relation" between DataSession and DataEnvironment?
>>
>>I know that a DE is a class, in charge of handling the cursors and relations. I also know about private or default DataSessions.
>>
>>My question is: Does the form DataEnvironment exactly match its private DataSession? In other words, are the Data in the DE corresponding exactly to the data of the private datasession? If I switch the dataEnvironment at runtime in my form, will the DataSession remain the same or not? Have I got ONE DE for ONE Datasession and vice versa?
>>
>>Is my QuestionSET clear?
>>
>>Thank you
>
>I would say Private DataSession>=DataEnvironment. :)
>Private DataSession along with the tables, views specified in your DataEnvironment includes also all areas/aliases which were open for example because they were specified as type of (SQL statement, Query) RowSource for list- or comboboxes, (or RecordSource for grid). Any table you opened with USE or cursor you created with SQL statement somewhere in your form also is included in your datasession (but not in Form.DataEnvironment).
Actually, I'd think of it in terms of a Class-Object relationship, at least when talking about private data sessions; the Data Environment is the Class used to create the Data Session instance. You can easily have two (or more) Data sessions up and running, based on the same Data Environment. Once up and running, the two data sessions can (and in most cases, do) diverge from each other in detail.
Ed