PRB: SQL_DRIVER_NOPROMPT Error in IIS 4.0 ISAPI Application

Last reviewed: February 19, 1998
Article ID: Q181434
The information in this article applies to:
  • Microsoft Visual C++, 32-bit Editions, version 5.0

SYMPTOMS

An ISAPI extension running under IIS 4.0 gives the following error when CDatabase::Open is called to open a database connection in an ODBC data source:

   Only SQL_DRIVER_NOPROMPT is allowed when connection pooling is enabled

RESOLUTION

Use the CDatabase::OpenEx function and specify the noOdbcDialog option to open your database connections.

   CDatabase db;
   db.OpenEx(_T("DSN=myDS;UID=myID;PWD=myPWD;"), CDatabase::noOdbcDialog);

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The SQL_DRIVER_NOPROMPT flag instructs ODBC to connect with the information passed in the connect string and to avoid displaying a login dialog box at run time.

CDatabase::OpenEx() with the noOdbcDialog option calls SQLDriverConnect with the SQL_DRIVER_NOPROMPT flag. Using the CDatabase::Open function causes MFC to use SQL_DRIVER_COMPLETE instead of SQL_DRIVER_NOPROMPT.

NOTE: Make sure you are using a "System DSN" and not a "User DSN" with an ISAPI application. The process for creating a System DSN is identical to that for creating a regular data source. Open the 32-bit ODBC Administrator (in the Control Panel) and click the System DSN tab, then click Add to create a System DataSources.

REFERENCES

Refer to the Visual C++ online help for a complete description of the OpenEx function.

For additional information and tips on using ISAPI and MFC ODBC, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q160906
   TITLE     : HOWTO: Use MFC 4.2 ODBC Classes in an ISAPI DLL

Keywords          : MfcDatabase
Technology        : odbc
Version           : WINNT:5.0
Platform          : winnt
Issue type        : kbprb


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 19, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.