Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class with private data session
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00832355
Message ID:
00832376
Views:
23
Hi Tommy,

Have you tried changing the datasession?

In our system, we have a program that calls a form and padding the current datasession as a parameter. In the init of the form, we save the form's datasession id and switch to the new one that was passed. This way we can acccess the tables, views, etc. that the calling program prepared.

I hope the piece of code below explains it more clearly.
** Form Init method
PARAMETERS nSessionID

THISFORM.nOldSessionID = nSessionID

IF PCOUNT() > 0
   SET DATASESSION TO (nSessionID)
ENDIF

** Form Release method
SET DATASESSION TO (THISFORM.nOldSessionID)
HTH,
Arriyel

>I have a licensing class that I created that runs on a timer. It adds a record to a table when people sign in and updates a time stamp on a specified interval so I can know how long they have been in the program. It works good with 1 exception.
>
>Periodically the timer fires that updates the record and the selected alias changes. It then causes problems in certain modules that happen to be open. In the timer code i always set the alias back to what it was when going into the code but I guess something with the sequencing causes problems with it.
>
>Putting the timer in a private data session would do the trick. I created a classed form and put my timer on it. Set datasession to private and set buffering to 5 for the table in question. It works ok. No more alias getting changed but now I can't access those records from other machines because it says the records are in use by another user.
>
>Does anyone know how to get those records accessable again. I use them to send messages to specific machines as well as other uses.
>
>Thanks in advance.
Speak using soft and sweet words in case you have to eat them later.
Previous
Reply
Map
View

Click here to load this message in the networking platform