FairCom Corporation


4.3.37 ctdbCreateSession


Create a new session table.

Declaration

CTDBRET ctdbCreateSession(CTHANDLE Handle, pTEXT dbengine,
pTEXT userid, pTEXT password)

Description

ctdbCreateSession creates a new session and session dictionary. The session dictionary will be created by default in the Server directory (client/server) or in the application directory (stand-alone). To change the directory to locate the session dictionary, use ctdbSetSessionPath before calling ctdbCreateSession. To create a database, use ctdbCreateDatabase. To create a table, use ctdbCreateTable.

A session dictionary is required to perform any task with a database, or to logon to a c-tree Server or c-tree Plus instance with ctdbLogon. There must not be more than one session dictionary in a c-tree Server or c-tree Plus environment.

Returns

ctdbCreateSession returns CTDBRET_OK on success, or c-treeDB C API error code on failure. If the error code is 19, the session dictionary already exists.

Example

err = ctdbLogon(handle);
if (err == FNOP_ERR) /* Session dictionary doesn't exist*/
err = ctdbCreateSession(handle, "FAIRCOMS", "ADMIN", "ADMIN");

See also

ctdbAllocSession, ctdbCreateDatabase, ctdbCreateTable, ctdbLogon


FairCom Corporation
www.faircom.com