Logging on to a database

About this task

To protect your databases from unauthorized users, HCL Compass requires that you log on to a database before accessing its records. For hooks, this user authentication is handled automatically by the HCL Compass client application. However, external applications must log on programmatically by using the Session object.

Procedure

To determine which database to log on to, and to perform the log on, follow these steps:
  1. Get a list of the databases associated with a schema repository by calling the GetAccessibleDatabases method of the Session object.

    This method returns a collection of DatabaseDesc objects, each of which contains information about a single user database.

  2. Use methods of the DatabaseDesc Object to get specific database information such as the name of a database or the database set (a schema repository and its associated databases) to which a database belongs.
  3. Log on to the database by calling the UserLogon method of the Session object.

    You must have a valid login ID and password to log on to the database. As soon as you log on, you can start looking through records and creating queries. (See the description of the UserLogon method for usage information.)

Results

Note: If your external application uses Session methods, the general rule is to call UserLogon before calling other Session methods. However, there are Session methods that you can call before calling UserLogon such asGetAccessibleDatabases and OutputDebugString.