Topics Topics


Connection keywords


Connection keywords and strings

Whether you are using a third-party ODBC-compliant application or creating your own program, one way to connect to a data source is to call an ODBC API function. Depending on the method you use, you may either call the function explicitly or have it called for you by an application or other software layer (such as ADO).

When you call SQLBrowseConnect or SQLDriverConnect, you pass keyword/value pairs in a connection string. NotesSQL supports the following general keywords for the SQLBrowseConnect and SQLDriverConnect calls:

KeywordDescription
DSN The name of the data source.
Database The name of the Notes database, with a path if necessary.
Server The name of the Notes server where the database is located.

If the database is on the local workstation, leave this field blank.

DRIVERThe name of the ODBC driver.
UIDThe user name to connect to the data source.
PWDThe password to authenticate the user name.

If you use the DSN keyword, that is the only keyword required. If you do not use the DSN keyword, only the Database and DRIVER keywords are required. If you do not specify a server, the local machine is assumed.

If you specify a DSN that contains user name and password information, and also supply UID and PWD keyword/value pairs, the separate UID and PWD values override the values in the DSN.

To connect to the Personnel data source, you would use the following connection string:

DSN=Personnel;

To connect user John Cook to a database in the directory PERSONNEL on server HR_1, you would use the following connection string:

DRIVER = {Lotus NotesSQL 3.01 (32-bit) ODBC DRIVER (*.nsf)}; Database=Personnel\employee.nsf; Server=HR_1;UID=JCook; PWD=RedJello;

NotesSQL supports the following driver-specific keywords:
KeywordMinimumMaximumDefaultDescription
MaxVarcharLen215360254This parameter specifies the maximum number of bytes NotesSQL allows in a string associated with a text field. This limits the number of characters returned from a Notes text field and the length of a string to be inserted into a Notes text field.
MaxLongVarcharLen215360512This parameter is similar to MaxVarcharLen, but it applies to rich text fields.
KeepTempIdx011This option controls the saving of temporary indexes. Set to 1, temporary indexes will be saved until disconnect() is called. Set to 0, temporary indexes will be deleted at the end of each SQL statement.
ShowImplicitFlds010This option controls whether certain Notes fields are provided through DatabaseMetaData. Set to 0, internal fields will not be shown. Set to 1, internal fields will be shown.
MapSpecialChars011This option controls whether certain characters are mapped to the underscore character ( _ ). Set to 0, no mapping will occur. Set to 1, special characters will be mapped to the underscore.

Each keyword has a minimum, maximum, and default value. If you do not specify a value, the default value is used.

SQLBrowseConnect an SQLDriverConnect return a connection string containing the keyword/value pairs you specified. We recommend that you specify a 512 byte buffer for the returned string.

These keywords correspond to the options you can set in NotesSQL dialog boxes when adding or modifying a data source. For more information, see "Configuring a Lotus Notes data source."


-------------------------------------------------------------------------------------------------------------------------------------------
If you're connected to the Web , click here to comment to Lotus on this documentation.