Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting out of a Method
Message
De
21/11/1997 08:50:29
 
 
À
20/11/1997 19:56:11
Edward Crawford
City Facilities Management
Glasgow, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00061522
Message ID:
00061581
Vues:
33
>>>I have a process that is done once a month that requires exclusive use of a table. I know of no way to check to see if a user on the network already has this table open, so what I do is in the Error Event I check the error code. If the error code states that the file can not be opened exclusively, I show a MESSAGEBOX() to the user telling them that someone has the file open,and they must close it to continue. The problem is, when they click the OK button on the MESSAGEBOX, the user is then presented with the file locate dialog. How do I stop this behavior as well as the further processing of the method?
>>>
>>>-Ed

I've seen this handled using something like:

LOCAL lError, cError
lError = .F.

cError = SET('ERROR')
ON ERROR lError = .T.

USE table EXCLUSIVE

ON ERROR &cError

IF (lError)
*-- Unable to open the table
ENDIF

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform