Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Path Property

The default path for client/server applications is the server directory, while the default path for non-server applications is the application directory. If, for any reason, there is the need to modify the location of the session dictionary, CTSession.SetPath() may be used before creating and/or logging on to the session. CTSession.GetPath() may be used to retrieve the path for an active session.

Using this property, it is even possible to have multiple session dictionaries, in separate directories. This is not required, since the concepts of restricting access to different users to diverse tables or databases may be implemented inside a unique session dictionary.

The example below shows how to use the CTSession.SetPath() function to create a session dictionary file in a user specified directory, instead of the default directory:


CTSession ASession = new CTSession();

try

{

ASession.SetPath("\new\session");

ASession.Create("FAIRCOMS", "ADMIN", "ADMIN");

}

catch (CTException err)

{

Console.Write("Create session failed with error {0}\n", err.GetErrorCode());

}

TOCIndex