ANSITOOEM()

DBUsed()

This function tells you whether a specified database is open. It's the equivalent of USED() for database containers.

Usage

lInUse = DBUSED( cDatabase )
Unlike many other functions, this one doesn't have a default result if you omit the parameter. Calling DBUSED() without a parameter results in an error message.

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").


We haven't found a whole lot of uses for this function. We suspect it's more useful in developer tools, where you want to manipulate a particular database, than in client applications. One use in both situations, though, is to double-check that a particular database is still open before you try to SET DATABASE TO it.

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

ADatabases(), DBC(), Open Database, Used()


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net