Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quiting application when idle
Message
De
14/10/2004 13:03:31
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00951380
Message ID:
00951466
Vues:
7
>I need to kick the users out when they've being idle for some period of time, I know this could be simple but don't know how to do it. specially because you have to take in count that we're using sql server and an odbc conneccion to it, so i want to be sure that the sql server is not working on the background making some large query, then i don't want to kick the user out.
>
>but if it is idle and is not perfoming a sql query in the server, then I want to kcik him out

I suspect that perhaps what you really need is to take the users out, for maintenance. For example, to change the structure of the tables.

What I do in this case is send a signal to all applications, that it is time to quit.

The way I "send a signal" to the applications is to create a file with a certain reserved name, for example, "maintenance.tmp", in the shared data folder.

A Timer in the application will check every 2 minutes whether this file exists.

If it does, it will invoke goProgram.OnQuit(), that is, the Quit method for the application object (using VFX).

Note that if the user has an open dialog (e.g. "¿Do you want to save changes?"), the application will not quit.

Also - and this is positive for you - I believe that if the user is in the middle of a long process, the application will not quit until processing is complete.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform