Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Trapping an Open Table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00063492
Message ID:
00063564
Vues:
55
If I understand this the ON ERROR DO should be before any error takes place. Just as ON KEY LABEL has to be define before it can be used. I was working with it as the next line after attempting to open the table. Thanks >This should be an easy catch for any ON ERROR routine >Yours must not be in effect at the time of the error. >Check it with something like wait wait window ON("ERROR") >to see the current error handler. > > >Your error routine could look like this: >* Turn on the custom error handler >ON ERROR DO OnError WITH ERROR() > >* --- The on error procedure >PROCEDURE OnError >PARAMETER tnError >DO CASE >CASE tnError = 1705 >WAIT WINDOW "You can't have exclusive access now." >ENDCASE > > >RETURN > >You may even consider doing you error traping on an object >basis. > >Chris > >>I am having trouble figuring out how to trap an error that is >>produced if someone else has a table open when I am trying to open it >>exclusively inside a program . >> >>In my program I want it to let the current user know he can't do a >>specific operation, update and pack a table, because someone else >>is in the table. >> >>When I run it at present I get the standard error message box >>with the choice to cancel, ignore or help. A wait window would work >>stating that some else is in the table and this operation will now >>cancel but any 'ON ERROR' procedure I've made won't catch it >>because the program errors on >> >>SET EXCLUSIVE ON >> Select 0 >> USE openjobs Order 1 >> >>Any suggestions? >> >>Thanks in advance
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform