Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

Find Database

CTSession::FindDatabase() locates a specific database given the database name and, if the database exists, retrieves the database path. If a database cannot be found, CTSession::FindDatabase() returns NO (false).

// return YES if database exist or NO if database does not exit

CTBOOL DatabaseExist(CTSession& ASession, CTString& dbName)

{

CTBOOL Retval;

CTString dbPath;

try

{

Retval = ASession.FindDatabase(dbName, dbPath);

}

catch (CTException &err)

{

Retval = NO;

}

return Retval;

}

TOCIndex