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 false (false).
// return true if database exists or false if database does not exits
CTBOOL DatabaseExist(CTSession ASession, string dbName)
{
CTBOOL Retval;
StringBuilder dbPath = new StringBuilder();
try
{
Retval = ASession.FindDatabase(dbName, out dbPath);
}
catch (CTException err)
{
Retval = false;
}
return Retval;
}