LPARAMETERS Action && 1 EXCLUSIVE_MODE 2 NO EXCLUSIVE_MODE *-- Cette procedure à pour but de renvoyer .T. ou .F. si le dbc *-- ne peut pas être ouvert en mode exclusif.( ex si un autre utilisateur *-- a ouvert une table du dbc.) LOCAL lnretval lnretval = .T. CLOSE DATA ALL *-- VALIDATE Specifies that Visual FoxPro ensures that references in the database are valid. *-- Visual FoxPro checks to see that tables and indexes referenced in the database are available on disk. *-- Visual FoxPro also checks to see that referenced fields and index tags exist in the tables and indexes. TRY IF Action = EXCLUSIVE_MODE OPEN DATABASE ( THIS.cDefaultDatabase + '.dbc' ) EXCL VALIDATE && 11/2003 ELSE OPEN DATABASE ( THIS.cDefaultDatabase + '.dbc' ) ENDIF CATCH TO nDbcError WHEN nDbcError.ErrorNo = 114 *114 - L'index ne correspond pas à la table. Supprimez le fichier index et recréez l'index. (114) ERASE THIS.cDefaultDatabase + '.dcx' TRY OPEN DATABASE ( THIS.cDefaultDatabase + '.dbc' ) VALIDATE && 11/2003 CATCH lnretval = .F. ENDTRY CATCH TO nDbcError WHEN nDbcError.ErrorNo = 1551 *1551 - Le fichier "nom" n'est pas une base de données valide CATCH TO nDbcError WHEN nDbcError.ErrorNo = 1705 *1705 - Accès au fichier refusé. (1705) CATCH TO nDbcError WHEN nDbcError.ErrorNo = 3 *3 - Fichier en cours d'utilisation. IF Action = EXCLUSIVE_MODE lnretval = .F. ENDIF CATCH TO nDbcError WITH nDbcError THIS.Ctrlerror( .ErrorNo, .MESSAGE , .LINENO ,THIS ) ENDWITH FINALLY ENDTRY CLOSE DATA ALL RETURN lnretval