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.
- Handle [in] the session handle.
- dbengine [in] the string with the c-tree Server name or c-tree Plus instance name. If dbengine is NULL, ctdbCreateSession uses the string "FAIRCOMS" as the default server name or c-tree Plus instance.
- userid [in] the string with the user name. If userid is NULL, ctdbCreateSession uses the string "ADMIN" as the default user name.
- password [in] the string with the user password. If password is NULL, ctdbCreateSession uses the string "ADMIN" as the default user password.
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 |