AddConnection

(ODBC Manager Library)

Description:              Called to get the object value of an ODBC connection. If the connection does not exist, then a new ODBC DSN connection will be created and explicitly added to the ODBC Manager's internal list of DSN's

Returns:                    The object value of an ODBC connection

Usage:                       Script or Steady state.

Format:                      \ODBCManager\AddConnection(DSN[, UserName, Password, ConnectTimeout, ExecuteTimeout, IdleTime, CheckBackupTime, DisconnectOnError, HandleError, UseDriverTimeout, MirrorToDisk, DBType, PaceRecovery, PaceRecoveryRate, RollbackOnConnect, ReconnectDelay])

Parameters:             DSN  { text }  { required }  { no default }

                                                Identifies the database to connect to. This can be either a DSN (data source name) or it could be a connection string containing a fileDSN parameter such as: "filedsn = c:\vts\Access.dsn; dbq = c:\testdb1.mdb"

                                    UserName    { text }  { optional }  { no default }

                                      An optional parameter providing the user name for database access. If both the Username and Password are missing from the function call, a dialog box will prompt the operator to provide values for these parameters.

                             Password    { text }  { optional }  { no default }

                                      An optional parameter for providing the password, if required, for database access. See note for UserName.

                             ConnectTimeout    { numeric }  { optional }  { default: 30 }

                                      An optional parameter specifying the length of time the module will wait for a valid database connection to be made.

                             ExecuteTimeout         { integer }  { optional }  { default: 60 }

                                      An optional parameter specifying in seconds, the length of time the method will wait for a database command to execute.

                             IdleTime    { integer }  { optional }  { default: 600 }

                                      An optional parameter specifying in seconds, the length of time will wait with no database communication before closing the connection.

                             CheckBackupTime     { numeric }  { optional }  { default: 300 }

                                      Optional parameter specifying the length of time between checks for cache files left behind failed log attempts.

                             DisconnectOnError    { Boolean }  { optional }  { default: 0 }

                                      An optional parameter indicating whether the ODBC connection should be terminated after any execution error occurs.

                             HandleError {numeric T/F, module object or array}  { optional }  { default: false }

                                      An optional parameter which may be either an error handle object, an array of errors, or a simple value which may be either true to disconnect or false to indicate no disconnect.  Defaults to false, meaning 'no disconnect'.

                             UseDriverTimeout    { numeric }  { optional }  { default: 60 }

                                      An optional value which may be set to true if ODBC driver in use supports timeouts. If so, then the execution timeout limit is handed to the ODBC functions.  The local timeout limit will be set to be 5 seconds higher than the ODBC time limit.

                             MirrorToDisk          { Boolean }  { optional }  { default: false }

                                      If true, specifies that every write should go to disk.

                             DBType        { numeric }  { optional }  { default: 0 }

                                      Indicates the type of this DB connection (SQL, MySQL, etc.).

DBType

Meaning

0

MS SQL

1

MS Access

2

Oracle

3

MySQL

4

SyBase

                             PaceRecovery          { boolean }  { optional }  { default: 1 }

                                                Set to pace the recovery of logs to the value in the following parameter.

                             PaceRecoveryRate { numeric}  { optional }  { default: 0.1 }

                                      Sets the time in seconds for recovery of logs. PaceRecovery must be set to true.

                             RollbackOnConnect { numeric T/F}  { optional }  { default: 1 }

                                      Set to true to send a rollback on connect.

                             ReconnectDelay     { numeric }  { optional }  { default: 5 }

                                      Sets the time to wait for reconnect on failed connect.

Comments:               This module is a member of the ODBCManager Library, and must therefore be prefaced by \ODBCManager\, as shown in "Format" above.