Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSession
Message
From
10/11/2004 08:24:23
 
 
To
10/11/2004 04:20:59
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00959894
Message ID:
00959938
Views:
11
This message has been marked as a message which has helped to the initial question of the thread.
>I was thinking to use different DataSessions in my Appllication.
>Actually I'm developing an extension of a Program which was not made by myself. I can launch my app from a menu inside the main Program, so, when I start my App i have tables opened in some areas and the environment set by the main App. I was hinking that it would be nice if I could run my App in a private datasession so that i should not care about cloing tables and so on.
>My App start with a main program which set the environment and finally run a form which calls other forms by clicking different commandbutton. What can I do ?
>
>Alessio

Hi Alessio,

Have look at Session class (Introduced in VFP6/SP3)
It creates it's own datasession where u r free to open any data, run forms, do data processing run reports etc

This will not do any 'harm' to already open tables selected aliases record pointers etc...

When u release session object, all tables openened within are atomatically closed.

But this is not visual class, it is done in code!

Typical implementation goes like this
define class mydatasession as session

   procedure init
   this.open_data()

   procedure open_data
         *open data & relate tables

   procedure do_my_thing 

   procedure run_form
   procedure run_report
        


enddefine
After you have something like this in one of your public prgs
you can call it from anywhere by creating object based on this class
local oMySess
oMySess=createobject('mydatasession')
oMySess.do_my_thing()
It is in my opininon very flexible and practical concept,
and I use it for almost everything I do.


See manual for more deails about it.
Rgds++
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform