General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only