General Setup Tasks

These include Session Initialization, Add the Common Controls to the Project and Add a Reference to the LANSA Session Object.

Session Initialization

At runtime, Visual Basic needs to know which LANSA environment to connect to, such as the partition and database. Specify this information in a session configuration file. This file uses the same parameters as X_RUN.

To create a session configuration file:

1.  Open Notepad

2.  Copy the sample file below.

3.  Modify the parameters to suit your site requirements.

     These parameters can also be set programmatically with or without a session configuration file.

4.  Save the file to the directory that you will use to create your Visual Basic samples and exit Notepad.

Example Session.cfg files

LANG=e.g. ENG 

PART=partition e.g SET

DBII=your database's name

DBUS=database user - e.g. DBA

PSWD=database user password - e.g. SQL










DBIT=database type - e.g SQLANYWHERE,...


Add the Common Controls to the Project

The Windows Common Controls need to be included in your VB project.

1.  Open your Visual Basic development environment and create a new project using the standard Visual Basic project template.

2.  Add the common controls to the toolbox. Right-click in the toolbox and, from the popup menu, select Components:

3.  Select Microsoft Windows Common Controls 6.0:

3.  Click OK. The Common Controls are now available in the toolbox:


Add a Reference to the LANSA Session Object

You need to add a reference to the LANSA ActiveX library in order to use LANSA ActiveX components.

1.  Select References from the Project menu to add a reference to the LANSA ActiveX library.

2.  Select the box LANSA ACTIVEX LIB 1.0.

3.  Click OK.

4.  Save the project and form into a subfolder under the folder in which you saved your Session Configuration file. Use the default names of Project<n>.vbp and Form<n>.frm.

The setup is now complete.