Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ISRLOCKED doesn't work for me
Message
De
03/05/2016 14:44:23
 
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:
01635793
Vues:
68
A couple of things.

1) You can't be sure what REPROCESS is set to when you go into this code. Use SET("REPROCESS") to capture the current value, then set it accordingly at the end,

2) FINALLY will always run so you can take out the SET REPROCESS inside the CATCH and move the one at the end inside the FINALLY.


>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 
>
>
>The REPLACE statement attempts to lock all the affected records ( status = 5 ) and lock them.
>
>It can't, since I have one of the affected records locked in another instance of VFP.
>
>So I drop down to CATCH, then finally to the end.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform