Programming with Reflection

image\rwnprg32.gif Connect method

 

Syntax object.Connect [ConnectionName]

 

Description

Establishes a connection using the current connection type (the value of the ConnectionType property) and connection settings (the value of the ConnectionSettings property).

If a connection is already open when you use this method, an error is returned; you can use the Connected property to determine whether a connection is currently open. Further, you cannot change the connection type once a connection is open; however, you may be able to change certain connection setting keyword tokens. The tables of connection setting keywords show which settings can be changed.

Arguments

ConnectionName Argument Type: String
Optional
Specifies the name of a connection created using the Connection Directory. Use this property only if you have upgraded from an earlier version of Reflection (prior to version 6.0) and have elected to continue using the Connection Directory. If this argument is supplied, the Connect method ignores any previously configured connection type and connection settings, and instead uses the settings stored in the saved connection.

Note: If the Connect method is used to make a modem connection when no modem defined, one of the following will occur:

· If Reflection is using Control Panel modems (the default configuration), a dialog box asking if the user wants to run the Modem Control Panel to add a modem driver opens. If the user clicks Yes in this dialog box, the Install New Modem program is started; Reflection displays a second dialog box instructing the user to click OK when modem installation is complete. When the user closes the dialog box, Reflection dials the newly installed modem. If the user does not run the Install New Modem program or cancels the installation process before modem installation is complete, Connect returns rcGeneralConnectionError with .ConnectionErrorMessage set to "No modems installed."

· If Reflection is using the older Reflection Modem dialer (the UseModemDialerV5 property is set to True), a dialog box that lets the user define a modem opens. If the user cancels this dialog box, Connect returns rcGeneralConnectionError with .ConnectionErrorMessage set to "No modems installed." If the user selects a modem, Reflection dials the modem or prompts for a phone number if none has been configured.

 

image\jump.gif Example

image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command