Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I re-structure this user tracking feature?
Message
From
23/05/2002 15:26:35
 
 
To
21/05/2002 11:03:18
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00659398
Message ID:
00660713
Views:
11
Hello Big Brother,

You've run across a very common challenge. In my system I wanted one central table that would tell me what forms are up and in use by all users. I want this partly so that when they run maintenance procedures that I can tell the user who is using what form rather than just tell them that somebody is using something.

So, your table concept is very good. What I do in my system is I have several tables that I keep up at all times in datasession #1. Then each form comes up in a private data session and naturally takes other datasessions as its home as they each come up. So, in effect DataSession #1 is reserved for these central tables that are not buffered. I have one called LoadedUp that lists all forms in use by all users for everyone using the system at all times.

Of course when the form goes down the record in LoadedUp is deleted. A problem is that if power failures occur or the system is shut down through ctrl+alt+del, then you get false records in that LoadedUp table, so you'll have to figure a way to deal with that.

You can switch datasessions easily with :

SET DATASESSION TO 1

Before I do it I always record the current datasession by capturing SET('DataSession'). Then I know where to switch back when work is done in datasession #1. But it seems like when code is firing in a form that has a private datasession that it switches back automatically to the correct datasession. The forms are tied strongly to that private datasession.

There's only 1 more thing. You can't switch datasessions from some methods on the form, like the Init, it causes a problem. I found that it is simply bad practice to switch datasessions from any form methods. Instead, from within a form method or anywhere you can call a method in a non-visual custom object to do it instead. That works OK it seems as the non-visual custom object doesn't care where it does its work.

Wally Noll
Previous
Reply
Map
View

Click here to load this message in the networking platform