Previous Topic

Next Topic

Find Database

ctdbFindDatabase() locates a specific database given the database name and, if the database exists, retrieve the database path. If a database cannot be found, ctdbFindDatabase() returns INOT_ERR (101).

/* return YES if database exist or NO if database does not exit */
CTBOOL DatabaseExist(CTHANDLE hSession, pTEXT dbName)
{
    TEXT dbPath[MAX_NAME];

    return (ctdbFindDatabase(hSession, dbName, dbPath,
            sizeof(dbPath)) == CTDBRET_OK) ? YES : NO;
}