Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTSession::SetPathPrefix

Set the client-side path prefix.

Declaration

void CTSession::SetPathPrefix(const CTString& pathPrefix);

void CTSession::SetPathPrefix();

Description

A path prefix can be set anytime after the session handle is allocated. If a path prefix is set before a session logon, the new path prefix will affect the location of the session dictionary file. If a path prefix is set after a session logon, but before a database connect, then the path prefix affects only the database dictionary and any tables that are manipulated during that session.

A CTException is thrown when an error occurs. Use CTException::GetErrorCode() and CTException::GetErrorMsg() to retrieve the error code and descriptive message.

Return

void

Example


/* set a path prefix */

try {

MySession.SetPathPrefix("C:\FairCom\V8.14\ctreeSDK\ctreeAPI");

}

catch(CTException &E) {

printf("SetPathPrefix error: (%d) - %s\n", E.GetErrorCode(),

E.GetErrorMsg());

}

/* clear a path prefix */

try {

MySession.SetPathPrefix("");

}

catch(CTException &E) {

printf("SetPathPrefix error: (%d) - %s\n", E.GetErrorCode(),

E.GetErrorMsg());

}

See Also

CTSession::GetPathPrefix()

TOCIndex