CTSession::FindActive() locates a specific active database and returns the database object pointer. If the database is not active, CTSession::FindActive() returns NULL.
// Check if database is active
CTBOOL IsDatabaseActive(CTSession &ASession, const CTString& dbName)
{
return (ASession.FindActive(dbName) != NULL) ? YES : NO;
}
The function above is shown for example purposes only as the c-treeDB API method CTDatabase::IsActive() provides a more efficient way to check if a database is active or not.