world.DatabaseInfo

MUSHclient script function (Method) — introduced in version 4.40

Returns information about a database

Prototype

VARIANT DatabaseInfo(BSTR DbName, long InfoType);

Data type meanings

Description

This returns information about a particular database.

DbName - the identifying name of an existing database (as supplied to DatabaseOpen). Not the file name.

InfoType - the information you want:

1 - Name of database on disk

2 - Has a DatabasePrepare been validly done recently (and is still active)?

3 - Has a valid row been returned by DatabaseStep?

4 - Count of columns returned from the last DatabasePrepare.

Lua example

DatabaseInfo ("db", 4) --> get count of columns

Lua notes

Lua returns nil instead of a NULL or EMPTY variant.

Return value

The specified information about the database, as described above.
An EMPTY variant, if the database does not exist.
A NULL variant if the InfoType is not a valid type.

Related topic

Database (SQLite)

See also

FunctionDescription
DatabaseListLists all databases