>could'nt you use
>
>if used('filename')&& returns .t. if open
> select filename
> use filename exclusive
>else
> use filename exclusive
>endif
>
>hope this helps
>James
Unfortunately no. used() gets either Alias or workarea as parameter. Tablename might be different. But yes if you want to loop through all aliases in use and check their dbf().
There is another interesting thing though :
use mytable shared
use mytable in 0 again alias myNew Exclusive
doesn't give any error and opens the myTable in new workarea as SHARED.
This would mean looping through aliases you could hit the one opened "again" first and you shouldn't cut your check there.
I think there is no cheap way of determining if a table is opened somewhere already by you or by someone else.
Cetin