Hi all
I have a 10 tab page-frame and I would like to have 10 separate data-sessions. This is for ease of use because I have so many tables open but each tab does not use them. I just would like to open the tables that are used in each tab so the filters, pointer and relationships do not cross over tabs.
The Form’s Data-session is 2 – Private Data Sessions
In the LOAD of my form I create 10 data-session, 1 for each tab called TabSession1, Tabsession2 and so on.
The datasessions are created this way:
This works fine. Ten new sessions are created with the tables I want for each tab.
The problem is when the INIT of the objects on each tab are executed; errors are generated – specifically on the Grids.
Here is the Error:
Error Number: 2005
Message : Error loading file - record number 14. _grd_Search <or one of its members>. ControlSource : Alias 'MASTEXEM' is not found.
MastExem is open in DataSession 1 which correlates to Tab1.
I am thinking that at the INIT execution, VFP does not know about the multiple datasessions and it is ‘stuck’ on the default datasession.
Is there a solution/way around this?
I have a 10 tab page-frame and I would like to have 10 separate data-sessions. This is for ease of use because I have so many tables open but each tab does not use them. I just would like to open the tables that are used in each tab so the filters, pointer and relationships do not cross over tabs.
The Form’s Data-session is 2 – Private Data Sessions
In the LOAD of my form I create 10 data-session, 1 for each tab called TabSession1, Tabsession2 and so on.
The datasessions are created this way:
Code:
FOR i = 1 TO 10
cTab = "TabSession" + ALLTRIM( STR( i ) )
&cTab. = CREATEOBJECT("Session")
cTab = cTab + ".Name"
cName = "Tabsession" + ALLTRIM( STR( i ) )
cTab = cTab + " = 'Tabsession" + ALLTRIM( STR( i ) ) + "'"
&cTab.
Set datasession to i
Do Case
Case I = 1
*Open tables for this tab in data session “I”
Case I = 2
...
EndCase
Endfor
This works fine. Ten new sessions are created with the tables I want for each tab.
The problem is when the INIT of the objects on each tab are executed; errors are generated – specifically on the Grids.
Here is the Error:
Error Number: 2005
Message : Error loading file - record number 14. _grd_Search <or one of its members>. ControlSource : Alias 'MASTEXEM' is not found.
MastExem is open in DataSession 1 which correlates to Tab1.
I am thinking that at the INIT execution, VFP does not know about the multiple datasessions and it is ‘stuck’ on the default datasession.
Is there a solution/way around this?