Connect functions

Any ODBC function which establishes a connection, SQLConnect(), SQLDriverConnect(), or SQLBrowseConnect(), can be used with authentication modules.

Consider the following when using these functions.

The SQLConnect() function

The DriverCompletion parameter to the SQLConnect() function can take the following values
  • SQL_DRIVER_PROMPT
  • SQL_DRIVER_COMPLETE
  • SQL_DRIVER_COMPLETE_REQUIRED
  • SQL_DRIVER_NOPROMPT

If an authentication challenge is expected, it is recommended that you use SQL_DRIVER_NOPROMPT. Using other values might result in the user being presented with multiple requests for authentication information.

The SQLBrowseConnect() function

The SQLBrowseConnect() function is designed to be used iteratively where the driver provides guidance to the application on how to complete the connection string and the application prompts the user for the required values. This can create situations where the user is presented with multiple prompts between connection string completion and authentication.

Additionally, it is typical for the driver to present a choice of databases to the application as part of the connection string completion process. However, the driver is not able to query the server for a list of databases until after the user is authenticated. Depending on application logic, whether it provides a database name in the original connection string, and whether a challenge is going to be received from the authentication server, it might not be possible to use SQLBrowseConnect() when the server uses authentication.