Nadya,
I wrote a program to copy xls files from a server directory to my c:\. If a user has the file open, then my ON ERROR
routine will evaluate the error number returned by VFP. For example:
* CopyFiles.prg *
* if there is an error in any part of the program, pass it to ERRHAND.PRG *
ON ERROR DO C:\errhand WITH ;
ERROR(), MESSAGE(), MESSAGE(1), PROGRAM(), LINENO()
* errhand.prg *
PARAMETER errnum, mmessage, mmessage1, mprog, mlineno
DO CASE
*case:error= (108)file in use by another or (109)record in use by another? *
*(3) file is in use
CASE ERRNUM = 1102 && file being edited by someone else.
wait window 'The data cannot be updated until everyone is out of all spreadsheets.'+chr(13)+;
'Someone has at least one spreadsheet open on the server.' +chr(13)+;
'Click your mouse.'
quit && or do whatever other operation you need to do
CASE ERRNUM = 3 or ERRNUM=1705
* The file cannot be packed, try later. *
* just exit *.
ENDCASE
Précédent
Suivant
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