Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trapping Error 1709
Message
De
28/09/1999 17:52:54
 
 
À
28/09/1999 08:42:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00269767
Message ID:
00270256
Vues:
40
>
>You can't nest them, but you can issue an ON ERROR * inside your error routine. Yu can then subsequently check to see if the view opened.
>
>BTW, how do oyu use an error routine to open views?

Hi Erik,
Here's a stripped down version of an error handler that opens views automatically. Perhaps I am missing something, but it seems the suggestion you gave *is* a nested error handler. I tried adding a line in the ERR1 program that set a subsequent error handler (ERR2.PRG) in case of an error in ERR1 (like 1709 - Database is in use by someone else), but ERR2 is never called and the default VFP error handler displays the error message.

ON ERROR DO ERR1 WITH ERROR(),SYS(2018)

*ERR1.PRG - Begin
LPARAMETERS fpErrNo,fpErrParm
lcErr=ON('ERROR')

ON ERROR

DO CASE
CASE fpErrNo=13 && Alias is not found
IF INDBC(fpErrParm,'View')
* If the error parameter is a view in the current database
* then presumably a SELECT was issued without having USEd the
* view first. So, here, USE the view and then RETRY the
* SELECT statement that caused the error
USE (fpErrParm) IN 0 NODATA && USE the view
ON ERROR &lcErr && Reset the Error procedure
RETRY && Return to the SELECT that cause the error
ENDIF
OTHERWISE
ENDCASE
* Err1.Prg End
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform