RAD Studio
ContentsIndex
PreviousUpNext
Naming a Session

A session's SessionName property is used to name the session so that you can associate databases and datasets with it. For the default session, SessionName is "Default," For each additional session component you create, you must set its SessionName property to a unique value. 

Database and dataset components have SessionName properties that correspond to the SessionName property of a session component. If you leave the SessionName property blank for a database or dataset component it is automatically associated with the default session. You can also set SessionName for a database or dataset component to a name that corresponds to the SessionName of a session component you create. 

The following code uses the OpenSession method of the default TSessionList component, Sessions, to open a new session component, sets its SessionName to "InterBaseSession," activate the session, and associate an existing database component Database1 with that session:

var
  IBSession: TSession;
  ...
begin
  IBSession := Sessions.OpenSession('InterBaseSession');
  Database1.SessionName := 'InterBaseSession';
end;

 

TSession *IBSession = Sessions->OpenSession("InterBaseSession");
Database1->SessionName = "InterBaseSession";

For more information about using Sessions, see Managing Multiple Sessions..

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!