5. Working with a Database : How Programming for Multiple Sessions Works : How You Can Open a New Database Session : Connect Method
 
Share this page                  
Connect Method
Use this method to start a session that is different from any of the currently open sessions, for example, a session with a different database or a different set of DBMS flags.
The syntax is:
integer = DBSessionObject.Connect(database = varchar(256),[flags = varchar(256)])
The DBSessionObject object must not be open already (the state must be DS_DISCONNECTED) when you invoke this method. You can specify any database, including one to which the application already is connected.
flags
Lets you define the runtime environment for the session. For example, you can open a session as another user by specifying the -u flag.
If the Connect method succeeds in opening the connection, it returns ER_OK. If it does not succeed, it returns an error code.