Before terminating, an application has to close the open session. In this case, the Form_Unload event is used to call End Session:
Private Sub Form_Unload(Cancel As Integer)
If iSession > 0 Then
iRet = LceEndSession(iSession, LceFalse)
Note: Passing LceTrue as the second parameter (Resume) of LceEndSession will allow re-use of the same Session ID. This is more efficient than getting a new Session ID, if the same Host and Partition are required.
This concludes a quick introduction to LANSA Open functions in the Visual Basic environment. Detailed information about each LANSA Open function can be found in Function Details.