Hi Chaim -
That's because the USED() function does not actually check if a table.dbf is in use, but it only tells you if an alias name is used in the local, current datasession.
So you can Try to get exclusive access
TRY
use mytable again Alias myAlias in 0 excl
CATCH
Messagebox("Failed to ... ")
ENDTRY
IF USED('myalias')
ENDIF
hth
-Stefan
>Hi all
>How can I check if my table in use?
>When i try this:
> use mytable again in 0 excl
> I get meg\ssage that file access is denied becase my table is in use.
>But when I run the following code:
if used (MYTABLE.DBF')
>messagebox('Used', 0+16)
>else
>messagebox('Not Used', 0+64)
>endif
I get my messagebox answer that my table not in used.
>Help please