Qualifiers/Databases

The Open Data Services ODBC driver has the capability of exposing support for user selection of default qualifiers or databases. The concept of a default qualifier is the ability of the DBMS to set a default that automatically qualifies any table name by that default.

For example, SQL Server uses a default qualifier to assign a default database to a user as a result of the user login. Any table reference must be in that database unless an explicit qualifier is specified. This default qualifier can be either the first part (ODBC qualifier) or second part (ODBC ownerid) of the three-part table name. If user selection of a default qualifier is supported, the IDS_DATABASE_QUERY string contains the SQL statement used to fill in a list box of the supported qualifiers. The user can then select one of these qualifiers during SQLDriverConnect.

The initial selection of the list box is set to the qualifier returned from the IDS_DEF_DATABASE_QUERY string. The qualifier is set by the Open Data Services ODBC driver sending the IDS_AUX_USE string with the qualifier appended to the gateway for processing. The qualifier can also be set during DSN setup or can be passed to SQLDriverConnect using the database keyword. If the IDS_DATABASE_QUERY string is empty, the database control in the dialog boxes is disabled and the DATABASE keyword in the connection string is ignored.