Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Ed,
First thing.. I use a different way of determining if I can get a file exclusive.. I try to open the table, using the low level file open routine, The code is below:
* METHOD TO CHECK IF FILE CAN BE OPENED EXCLUSIVELY
PARAMETER tcFILE
LOCAL llFILESTAT
llFILESTAT=FOPEN(tcFILE,2)
=FCLOSE(llFILESTAT)
IF llFILESTAT > 0
RETURN .T.
ELSE
RETURN .F.
ENDIF
Secondly, after the user selects OK from the messagebox, the next line I would have is a return .f., and in the calling method, I would check to see what the called method returned. If it returned .f., I would act accordingly..
Thanx!
Tony Miller
Vancouver, Wa
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement