Nucleus ODBC Setup Guide for Windows Clients

 

Previous Topic:
Setting Advanced ODBC Options
Chapter Index
 

 

Using an ODBC Connection String


Instead of using a dialog box to enter data source connection information, some ODBC applications may require users to define a connection string, for example, in an ASP script. The connection string contains all of the information required by the ODBC driver to access the underlying SAND data source. A connection string has the following format (using command notation conventions):

"PARAMETER=value [ {; PARAMETER=value}... ]"


The following parameters must be included in the connection string:

CONNECTION= Connection-name corresponding to a [CONNECTION connection-name] section in the local nucleus.ini file. This indicates the host name or IP address of the computer on which the database instance is running, and the port number for connecting to the database instance.
DATABASE= Name of the database instance (real database or virtual instance) to which the user is connecting
DRIVER= The name of the ODBC driver, specified between braces { }, for example, {NUCLEUS ODBC Driver}. Alternatively, the full file name of the ODBC driver, including the path to the file (/path/ sando.dll).

 

The following parameters can be optionally specified in the connection string:

AUTOCOMMIT=

The Nucleus ODBC Driver can be set to automatically execute a COMMIT WORK command after each SQL statement that changes the database. The possible values are the following: 1 (on) or 0 (off) (equivalently true or false; equivalently yes or no).

Default: 0

AUTOREFRESH=

The Nucleus ODBC Driver can be set to execute automatically either a COMMIT WORK or ROLLBACK WORK command before each SELECT statement. This ensures that the client queries the most recent "view" of the database instance, which may be altered by other concurrent user connections. Some front-end applications (such as MicroStrategies DSS Agent) may require that this special option be set.

The possible values are the following: 0 (off), 1 or COMMIT (COMMIT WORK), and 2 or ROLLBACK (ROLLBACK WORK).

Default: 0

UID= The user ID that will be used to log in to the database instance.
PWD= The user password associated with the user ID specified by the UID parameter.

Note:
If the user ID or password is not supplied in the connection string, the user will be prompted to enter the required information.


Alternatively, if a DSN with the required information is already set up, the connection string can simply reference the DSN:

"DSN=data-source-name" (for a User or System DSN)

"FILEDSN=data-source-name" (for a File DSN)

Note that a DSN value need not be the only parameter: any other parameter included with the DSN value in the connection string takes precedence over the same parameter defined for the DSN. For instance, if "UID=DBA" was defined for the DSN, but the connection string contains "UID=BOB", the connection string value (BOB) will override the DSN value.


Example

"DRIVER=C:\WINNT\System32\sando.dll ; CONNECTION=serv1_db01 ; DATABASE=db01 ; AUTOCOMMIT=false ; UID=BOB"

 

Previous Topic:
Setting Advanced ODBC Options
Chapter Index