Programming with Reflection

image\rwnprg32.gif ConnectionSettings property



object.ConnectionSettings = Value

Works with


Data type




Returns (see the Note below) or specifies (second syntax line) the connection settings for the current connection type.

The value consists of alternating "keyword tokens" and "value tokens." The keyword token identifies a setting; the value token specifies a value for the setting. Keyword tokens need not be specified in any specific order. For example, in the following statement:

Session.ConnectionSettings = "Parity 7/Even"

the keyword Parity is given a value of 7/Even.

Different keyword/value pairs are relevant for different connection types. The entire configuration string must be enclosed in quotation marks. If a value token contains double quotation marks or a backslash character, you must precede that character with a backslash character. If a value token contains spaces, the token must be enclosed in single quotes or in two sets of quotation marks; for example:

Session.ConnectionSettings = "ConnectMacroData 'a b c'"


Session.ConnectionSettings = "ConnectMacroData ""a b c"" "

Click here for information on which keyword and value tokens are relevant for each connection type.

For any given connection type, the complete ConnectionSettings string can be quite lengthy. For example, the connection settings string for a Telnet connection might look like this:

CheckParity False Parity 8/NONE CharDelay 0 Host "" TelnetPort 23 TelnetBreak False TelnetBinary False TelnetLFAfterCR False TelnetInitOptionNegotiation True TelnetTermType VT220 SettingsFile "" TelnetEcho Auto TelnetUseEmulatorTermType False TelnetSetWindowSize True TelnetLinemode Never UseSOCKS False TelnetTrace False ExitAllowed True ExitOnDisconnect False UseThreadedIO True ConnectMacro "" ConnectMacroData "" ConnectionName ""

You usually do not need to specify an entire configuration string in order to establish a connection. Instead, you need only specify the keyword and value tokens for the settings you need to specify explicitly; current values are used for the keywords you do not specify. For example, if you want to change only the setting for allowing an exit while connected, you could use this statement:

Session.ConnectionSettings = "ExitAllowed False"

All other settings for the current connection type remain unchanged.

If you specify a keyword token that's not relevant for the connection type, Reflection generates an error. Likewise, if the value you assign to the ConnectionSettings property contains any invalid keyword or value tokens, Reflection stops reading the string at the invalid token and returns an error. Your macro should contain an error-handling routine to trap and deal with the error (by displaying a message box, for example).


If you want to return the value of a single keyword token, use the ConnectionSetting method.


The default value varies depending on your connection type.

If you change the connection type, the keyword/value pairs of the ConnectionSettings property are restored to the defaults for that type.


image\jump.gif Example

image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this property