Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error 114 no repaired
Message
 
 
To
14/11/2003 17:00:35
General information
Forum:
Visual FoxPro
Category:
Stonefield
Miscellaneous
Thread ID:
00849527
Message ID:
00850414
Views:
23
Hi Doug,

This code functions for error 114. goapp.lOpenDatabase( 1 or 2 )
Can you please to say to me if he is well written ?
It is regretable that one can't include a retry clause in the try Cath command.
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
Previous
Reply
Map
View

Click here to load this message in the networking platform