>>Without using AUSED, you would have to attempt a USE on the table and see if it fails (obviously with error handling). Not cool.
>
>Why not?
Because it's a kludge to write code that tried to disable an error handler temporarily and then (hopefully) restores it when done. Further, if the function got called from an object whose class has an Error method, this approach won't work.
The only robust way that I know of to accomplish it is to define a class to do it for you, and have that class contain an error method to deal with the issue. Something like:
FUNCTION IsOpenElsewhere( lcTable )
LOCAL loChecker, llResult
loChecker = CREATE( "IsOpenElsewhereChecker" )
llResult = loChecker.Check( m.lcTable)
RETURN m.llResult
DEFINE CLASS IsOpenElsewhereChecker AS RELATION
lError = .F.
FUNCTION Check( lcAlias)
USE &lcAlias IN 0
IF NOT THIS.lError
USE IN ( m.lcAlias )
ENDIF
RETURN NOT THIS.lError
ENDFUNC
FUNCTION Error( p1, p2, p3)
THIS.lError = .T.
ENDFUNC
ENDDEFINE
-- Randy