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
>>
>>
>>Please show the code snippet.
>>:)
>
>SET SAFETY OFF
>USE oAppManager.TablePath + "phlog.dbf" EXCLUSIVE
>** an error 1705 will occur here if the file is in use
>
>****** Error Event Code ****
>
>IF nError = 1705
> MESSAGEBOX("Error Message Here", 64, "Problem Alert")
>
>ELSE
> lnAnswer = MESSAGEBOX("Alternate Error Message", 17, "ERROR")
> IF lnAnswer = 2
> CANCEL
> ENDIF
>ENDIF
Can You attempt an FLOCK() before opening the file?
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