Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datasession behavior
Message
From
24/09/1997 20:29:57
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00051207
Message ID:
00051504
Views:
40
>One technique I use to solve the problem you mention is to create a global object. If you execute the following code any time during your application startup when the default datasession is active, the object will remember that it was instantiated in the default datasession.
>
>PUBLIC goControlFileInterface
>
>goControlFileInterface = CREATEOBJECT("cControlFileInterface")
>
>DEFINE CLASS cControlFileInterface AS CUSTOM
>PROCEDURE ControlFileMethod1
> *-- Put code here to work on tables in default datasession
>ENDPROC
>ENDDEFINE
>
>
>If you ever make a call to this object e.g. goControlFileInterface.ControlFileMethod1() VFP will take care of changing datasessions for you automatically. It will change it to the default datasession upon entry to the method and will return back to its previous datasession on exit. As long as you always know what datasession was active when an object is instantiated you should never have to change the datasession property manually.

Thanks, you might want to create an entry in the Knowledge Base FAQ section for this.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform