Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Maintaining data session state
Message
 
 
To
21/09/2002 18:45:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00703118
Message ID:
00703120
Views:
14
Object methods are always executed in the datasession object was created under.

>Given the following code:
>
>
>loTest=CREATEOBJECT('Test')
>MESSAGEBOX('Data session after having created Test: '+STR(SET('DATASESSION')))
>
>loPrivateData=CREATEOBJECT('PrivateData')
>SET DATASESSION TO loPrivateData.DataSessionID
>MESSAGEBOX('Data session now switched to 2: '+STR(SET('DATASESSION')))
>
>loTest.Go()
>
>DEFINE CLASS Test AS Custom
>FUNCTION GO
>MESSAGEBOX('Data session inside method is switched back to 1: '+STR(SET('DATASESSION')))
>ENDFUNC
>ENDDEFINE
>
>DEFINE CLASS PrivateData AS Session
>ENDDEFINE
>
>
>Can someone explain me why calling a method from the Test object resets the data session to 1? We are sitting on data session 2 when calling that method. Why it is resetting itself to 1?
>
>I need to maintain the data session state. How can I make that work?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform