vfp 9, SP1
The point of the following was to determine if an ODBC connection is
available on the current machine and it works fine for that purpose.
However the added ? statements show what seems to me to be a bug.
? DBUSED('lms_logger') && returns .F.
TRY
USE (odbc_path+'lms_logger!header_view') IN 0 ALIAS test
rtn=.T.
CATCH
rtn=.F.
ENDTRY
IF rtn
USE IN 'test'
ENDIF
? DBUSED('lms_logger') && returns .T.
*
* However, if you try to create an SQL view at this point, it throws
an error
* that no database is open
*
CLOSE DATABASE
? DBUSED('lms_logger') && still returns .T.
OPEN DATABASE (odbc_path+'lms_logger)
CLOSE DATABASE
? DBUSED('lms_logger') && is now F
There is probably a better way for me to test the connection. And,
this is easy enough to work around. Still, it seems to be odd
behavior.
G