APIDb_​GetCurrentDatabaseID

Returns the identifier of the current (active) database.

    GSErrCode ACAPI_Database (
        APIDb_GetCurrentDatabaseID,
        API_DatabaseInfo*     databaseInfo
    );

 

Parameters

databaseInfo
[out] The identification parameters of the current database

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
databaseInfo is nullptr
APIERR_BADWINDOW
the type of the current database is not known by the API

For other common API errors see the API Errors document.

 

Remarks

This function is used to return the parameters of the current database of the server application. It can be used to identify which database the subsequent API calls will work on.

Generally the current window and the window of the current database are the same. However you must be careful; the database dependent functions work on the current database not on the database of the current window. You can change the current database by calling the APIDb_ChangeCurrentDatabase function.

 

Example


API_DatabaseInfo    databaseInfo;
GSErrCode           err;

BNZeroMemory (&databaseInfo, sizeof (API_DatabaseInfo));
err = ACAPI_Database (APIDb_GetCurrentDatabaseID, &databaseInfo, nullptr);

 

Requirements

Version: API 4.1 or later
Header: APIdefs_Database.h

 

See Also

API_DatabaseInfo
APIDb_ChangeCurrentDatabase
ACAPI_Database
API Functions