Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test for a file used by someone else
Message
De
03/11/2003 10:17:56
 
 
À
03/11/2003 10:15:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00845609
Message ID:
00845614
Vues:
15
Oscar

The only way to achieve this is to trap the error generated when a Table cannot be opened exclusively:

Prior to VFP8.0
LOCAL llInUse
ON ERROR llInUse = .T.

USE TableName EXCLUSIVE

IF llInUse
    *Error occurred, table in use
ENDIF
In VFP8.0, however, it's less messy:
LOCAL loException AS Exception

TRY
    USE TableName EXCLUSIVE
CATCH TO loException
    *Table in use
ENDDTRY
HTH
Kev

>Hola
>
>I need to copy or Use a table which me be opened by someone.
>
>How can I test if it is in use by someone else without generating an error?
>
>Thanks in advance for any hints.
>
>
>Oscar Corte
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform