Signon dialog behavior

The signon dialog behavior has been simplified from the behavior seen in previous iSeries™ Access for Windows® ODBC drivers. The signon dialog behavior is based on how your data source is set up and which ODBC API (SQLConnect, SQLDriverConnect, SQLBrowseConnect) your application uses to connect.

When configuring an ODBC data source there are two options which can influence the signon dialog behavior. These are both located on the dialog you get after clicking Connection Options on the General tab of the DSN Setup GUI.
Note: On the DSN setup GUI there is an option which controls whether or not a dialog prompting for signon information is allowed or not. An application that calls SQLConnect in a 3-tier environment should always choose 'Never prompt for SQLConnect'. This 3-tier application also needs to make sure it specifies the userid and password when calling SQLConnect.

When coding your application you have total control over how the userid, password, and signon dialog prompting will behave. The userid and password that is used is figured out in the following order:

  1. Userid / Password arguments specified by the application.
    • The SQLConnect API accepts userid and password arguments.
    • The SQLDriverConnect and SQLBrowseConnect APIs accept the UID, PWD, and SIGNON connection string keywords.
  2. GUI setting for Default user ID

The signon dialog prompting depends on which ODBC API is used by the application to connect. SQLConnect prompts the signon dialog if needed unless the GUI setting for Signon dialog prompting says to never prompt. SQLDriverConnect prompts the signon dialog according to the value of the DriverCompletion. A setting of SQL_DRIVER_NOPROMPT will prevent any signon dialogs from being prompted. A setting of SQL_DRIVER_PROMPT, SQL_DRIVER_COMPLETE or SQL_DRIVER_COMPLETE_REQUIRED will prompt the signon dialog if needed. SQLBrowseConnect prompts the signon dialog if needed.

ActiveX Data Objects (ADO) prompting

When coding your ODBC application using ActiveX Data Objects (ADO) the default behavior for prompting is adPromptNever. To prompt differently, set the Prompt property on the Connection object prior to calling the Connection's Open method. For example, the following ADO code would result in prompting only as needed. Adding the SIGNON, UID, or PWD keywords allow you to have more control over the amount of prompting.

Dim conn As New ADODB.Connection  
conn.Properties("Prompt") = adPromptComplete  
conn.Open "Provider = MSDASQL;DSN=myODBCDSN;