Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to close all files used by other computers?
Message
De
07/07/2002 14:04:01
Wally Noll
Double Aa Builders
Mesa, Arizona, États-Unis
 
 
À
05/07/2002 13:41:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00675713
Message ID:
00675954
Vues:
8
Kouakou,

that is a very good question and I don't know the answer.

But what I do is I've built a system that keeps track of what user is using what tables, so that when I want to perform a maintenance procedure that requires EXCLUSIVE access to data tables I can at least identify who has the tables up to tell user that these people have to shut down first. Obviously, I have a table on the hard drive that receives a new record every time a user loads a form or does something that causes a table to load. When the user shuts down the form the record goes away. Thus, that central table records what user is using what at all times. A problem was that when the user experiences power failure and doesn't shut down normally, then the record remains in the table and is a false record as to what is in use.

The other technique you can use to identify in an absolute sense if someone else has a table open is as follows. When you cycle through the tables and open each one in EXCLUSIVE mode, then an error will be generated on those tables that someone else opens. You build a special error handler to be in effect during this time. That error handler will simply assist in tallying the number of times that the error occurs. If it occurs zero times, then you know beyond any doubt that nobody else is using the tables.

I don't think it's possible for one VFP exe to force another exe on the network to shut down. The other one has to do it on its' own. But what some people try to do is they put a timer into the form that checks some table to see if it is instructed to shut down. Then you would just modify values in that table when you want others out, then the timer would check and then the other exe would know that it must shut down now. I personally wouldn't mess with timers in this manner though because it just puts a burden onto the normal functioning of the system.

Wally
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform