Add the Visual Basic Form

Visual LANSA

Add the Visual Basic Form

In this step you create the Visual Basic form which uses the non-visual LANSA ActiveX components to manage employee information in the LANSA Personnel System demonstration files:

1.  Complete the General Setup Tasks to create a new Visual Basic project.

2.  Close Visual Basic.

3.  Start Notepad and open the form (Form<n>.frm) created in the General Setup Tasks.

4.  Replace the code in Notepad the source code from Case 3 - Visual Basic - Object, then Save.

5.  Open the Project (Project<n>.vbp) in your Visual Basic development environment.

6.  Open the form (Form<n>.frm)

7.  Replace the code with the source code from Case 3 - Visual Basic - Code, then Save.

8.  Select the Project menu and then the References…option.

9.  Scroll down and select LANSA.AXOBJECTA and LANSA.AXOBJECTB.  Click OK. This will add a Reference for each object to the project.

     Notes:

  • If your Toolbox is not displayed, click View then Toolbox.
  • To view the form's user interface, Click View, then click Object from the Menu or by using the Project Pane.
  • If you have an empty list at runtime then check the view style, it should be lvwReport
  • You do not need to add the LANSA ActiveX business objects to the toolbox or the form.

10. In the LOAD routine modify the login script below to your requirements. For example:

      Call ConnectToLansa("user1", "mypassword", "c:\ActiveXTests\session.cfg")

 

11.  Save, then compile the Visual Basic Project using the Make Project<n>.exe option in the File menu.

 

Ý Case 3 - Use Components as Business Objects