Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Terminal Object / Connect Method
Example
Connect Method (Terminal)
Connects to the host. It is ignored if a connection already exists.
Syntax
expression.Connect() As ReturnCode
where expression is a variable that represents a Terminal Object

Return Value

One of the following ReturnCode enumeration values.

Member Description
Cancelled Cancelled.
Error Error.
PermissionRequired Permission is required.
Success Success.
Timeout Timeout condition.
Truncated The text is truncated.

Remarks
Use the IsConnected property to determine if a connection already exists. Use HostCommTimeout to specify how many seconds Reflection should wait for a host response.
Example
'This example switches a connection from telnet to SSH and saves the session
Sub ConnectExample()
 
    If ThisTerminal.connectionType = ConnectionTypeOption_Telnet Then
        'First disconnect so you can change the settings
        ThisTerminal.Disconnect
    
        'Change the connection type
        ThisTerminal.connectionType = ConnectionTypeOption_SecureShell
        
        'Reconnect and save with the new settings
        ThisTerminal.Connect
        ThisTerminal.Save
    End If
 
End Sub
See Also