This example displays a confirmation message box with the current host name and Yes and No buttons. If the user clicks No, the Continue argument is changed to False (from the default value of True) and Reflection doesn't proceed with the connection.

Private Sub Session_BeforeConnect(Continue As Boolean)

 Dim confirm As Integer 'Response to message box

 Dim host As String 'Current host name


 'Get the current host name

 host = Session.ConnectionSetting("host")


 'Display a message box and get the user response

 confirm = MsgBox("Connect to " & host & "?", vbYesNo)


 'Set Continue to False if user clicked No

 If confirm = vbNo Then Continue = False

End Sub