ctdbLogon
Log on to FairCom Server or FairCom DB instance session.
Declaration
CTDBRET ctdbLogon(CTHANDLE Handle, pTEXT dbengine, pTEXT userid,
pTEXT password)
Description
ctdbLogon() logs on to the c-tree Server or FairCom DB instance. Before any database operation can take place, initiate a session with ctdbAllocSession() and then logon to the c-tree Server or c-tree Plus instance using ctdbLogon() before calling ctdbAllocDatabase().
Before logon to the c-tree Server or a FairCom DB instance, it is necessary to have a session dictionary. To create a session dictionary, use the function ctdbCreateSession().
To logout from the c-tree Server or FairCom DB instance, use the ctdbLogout() function.
Returns
ctdbLogon() returns CTDBRET_OK on success, or c-treeDB API C API error code on failure.
Example
CTSESSION_TYPE ctdbsess=CTSESSION_CTDB;
CTHANDLE hSession = ctdbAllocSession(ctdbsess);
CTDBRET err;
err = ctdbLogon(hSession, "FAIRCOMS", "ADMIN", "ADMIN");
err = ctdbCreateDatabase(hSession, "MyDatabase", "");
err = ctdbLogout(hSession);
ctdbFreeSession(hSession);
See also
ctdbLogout(), ctdbAllocDatabase(), ctdbCreateSession(), ctdbIsActiveSession()