Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

ADATABASES()

This function fills an array with the list of open databases. It gives you both the name and the path for each database.

Usage

nCount = ADATABASES( aDatabaseArray )

Like the other Array Manipulation functions, ADATABASES() returns the number of rows in the array created. Similarly, if there are no open databases, ADATABASES() returns 0 and doesn’t create or change (if it already exists) the specified array.

The function does not honor the setting of SET FULLPATH, but we think that’s good. No matter what, the second column contains the full path to the database.

Example

CLOSE DATA ALL        && make sure no databases are open
? ADATABASES(aDbs)    && returns 0
OPEN DATA (_SAMPLES+"TasTrade\Data\TasTrade")
? ADATABASES(aDbs)    && returns 1

See Also

ADBObjects(), Array Manipulation, AUsed(), Open Database