Description

Creates a Connection Object instance and returns the handle.

Syntax

hXO = XOInstance (sourcename, sourcetype, loginID, password, timeout, options, scope)

Parameters

The XOInstance function has the following parameters:

ParameterDescription
SourcenameOpenInsight data source name.
SourcetypeData source type.
LoginIDUser name used to connect to the data source.
PasswordPassword used to connect to the data source.
TimeoutNumber of seconds to wait for a connection.
OptionsA bit-masked number that specifies connection options. Select one from each group.
GroupDescription
Transactions

Specifies whether transactions will be used.

ValueConstantDescription
0XO_USETRANS$Uses transactions (default).
1XO_NOTRANS$Does not use transactions.
Shareable

Allows the caller to either share connections (to minimize the number of open connections) or specify a connection "not shared" (to minimize the possibility of interference between processes).

ValueConstantDescription
0XO_NOSHARE$Does not share connections (default).
2XO_SCOPEDSHARE$Requests a shared connection within a specifies scope.
4XO_GLOBALSHARE$Requests a public connection handle.
Login Dialog

Determines whether the Login dialog box will be used to collect login information.

ValueConstantDescription
0XO_LOGINDIALOG$Displays the dialog if attempted login fails (default).
8XO_NODIALOG$Returns an error if the login fails (does not prompt the user for login information).
16XO_ONLYDIALOG$Gives the user an opportunity to specify login information before attempting to connect.
Resolve Parameters

Allows XOInstance() to fill in unspecified parameters using system defaults and previously entered information.

ValueConstantDescription
0XO_RESOLVE$Automatically fills in missing connection (default).
32XO_NORESOLVE$Does not automatically modify the connection parameters.
ScopeIf the XO_SCOPEDSHARE$ option is specified, this parameter defines the name by which the Connection Object will be shared.

Returns

Handle to the Connection Object.

Remarks

/* If the system connection default is not set to XO_NODIALOG$ 
then this will prompt the user for connection information and return the Connection Object. */
 
hXO = XOInstance()
 
/* Attempts to connect to the ODBC data source: "CUSTOMER" using the specified login and password, and default timeout. */
 
hXO = XOInstance ("CUSTOMER", "ODBC", login, pwd, "", |
XO_USETRANS$ + XO_GLOBALSHARE$ + XO_NODIALOG$ + XO_NORESOLVE$)
  • No labels