Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test for a file used by someone else
Message
From
03/11/2003 10:17:56
 
 
To
03/11/2003 10:15:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00845609
Message ID:
00845614
Views:
14
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
Previous
Reply
Map
View

Click here to load this message in the networking platform