DBUsed()
This function tells you whether a specified database is open. It's the equivalent of USED() for database containers.
Usage |
lInUse = DBUSED( cDatabase ) |
DBUSED() incorrectly returns .F. if the database is open but isn't in the current directory and you specify an extension but no path (for example, "TESTDATA.DBC"). |
Example |
CLOSE ALL CD HOME() ? DBUSED("TasTrade") && Returns .F. OPEN DATA _SAMPLES + "TasTrade\Data\TasTrade" ? DBUSED("TasTrade") && Returns .T. ? DBUSED(DBC()) && Returns .T. ? DBUSED("TasTrade.DBC") && Returns .F. -- bug! CLOSE DATA USE Customer && Automatically opens database ? DBUSED("TasTrade") && Returns .T. |
See Also |