Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ISRLOCKED doesn't work for me
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01635773
Message ID:
01635803
Vues:
58
>This tested ok.....
>
>
>TRY
>	SET REPROCESS TO 1
>	REPLACE status WITH 2 IN ss_io FOR status = 5
>CATCH
>	SET REPROCESS TO AUTOMATIC 
>	MESSAGEBOX("Cannot delete the records at this time.....  another user has has one of the records open at this time.... try again later",0+16,"Cannot Delete Records")
>FINALLY
>ENDTRY 
>
>SET REPROCESS TO AUTOMATIC 
>
>


Adding to Craig's post, I would set the exception in the catch, as the issue with the replace is not unique, it is possible that, for example someone changed the type of status without you knowing it, so you'll keep thinking the problem is about a lock when in fact is something else, something along this lines (or you can make it more complicated by using WHEN for each exception you expect) :
local loException

*** blah blah

CATCH TO loException
	MESSAGEBOX("Cannot delete the records at this time.....  " + loException.Message + ".... try again later",0+16,"Cannot Delete Records")

*** blah blah
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform