This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Set backup hosts programmatically

Is is possible to set the backup hosts programmatically using VBA code?

I can set the current connection and port under code as follows but cant seem to find a way to set the backup hosts.

ThisIbmTerminal.HostAddress =

ThisIbmTerminal.port =

Tags:

Labels:

Reflection
  • Verified Answer

    +1  

    Hi Stephen Morley,

    There is no property for ThisIbmTerminal.BackupHostAddress in VBA.  You can solve this by adding logic to your VBA code that waits to see if the first connection fails and then changes the value for ThisIbmTerminal.HostAddress to the secondary address you wish to attempt.  The other option would be to call an existing session that is configured with a primary and backup host.

    Regards,

    Jeff B

  • 0 in reply to   

    HI Jeff B,

    Thank you for the reply - appreciate it.

    I had come to the same conclusion so thank you for the confirmation.

    As a FYI I am setting the connection details as follows (in the BeforeConnect Event):-

    Private Sub IbmTerminal_BeforeConnect(ByVal sender As Variant)

        ThisIbmTerminal.HostAddress = ?
        ThisIbmTerminal.port = ?


    End Sub

    The values for the ? come from a config file.

    Can you please suggest how I can wait and see if the first connection fails and then change the address?

    Thank you in advance.

    Regards

    Steve

  • Verified Answer

    +1   in reply to 

    Hi Steve,

    You can use ThisIbmTerminal.IsConnected to find out if the connection was made.  You may also want to customize the connection time out using ThisIbmTerminal.HostCommTimeout to shorten the amount of time (default 60 seconds) you have to wait for the first connection to fail.

    Also note that ThisibmTermainal.Connect method has a return code that you can use in your logic.

    Regards,

    Jeff B

  • 0 in reply to   

    Thank you Jeff