PRB: TRACE() Messages Displayed When Opening Database

Last reviewed: July 18, 1997
Article ID: Q112823
1.50 4.20 WINDOWS kbprg kbprb

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC), included with:

        - Microsoft Visual C++ for Windows, versions 1.5, 4.2
    

SYMPTOMS

The following TRACE() messages appear in the Output window when calling CDatabase::Open() or CRecordset::Open():

   Warning: ODBC Success With Info, Driver's SQLSetConnectOption
            failed
   State:IM006,Native:0,Origin:[Microsoft][ODBC DLL]

   Driver not capable.
   State:IM006,Native:0,Origin:[Microsoft][ODBC DLL]
   State:S1C00,Native:0,Origin:[Microsoft][ODBC Single-Tier Driver]

CAUSE

In CDatabase::AllocConnect() located in DBCORE.CPP, the Microsoft Foundation Classes (MFC) contain the following line of code:

   AFX_SQL_SYNC(::SQLSetConnectOption(m_hdbc, SQL_LOGIN_TIMEOUT,
         m_dwLoginTimeout));

Because ODBC (Open Database Connectivity) doesn't provide a way to determine whether or not an ODBC driver uses a "login time-out," the database classes always try to set it before trying to connect. If SQLDriverConnect() is called and the driver doesn't support login time- outs, the above ODBC warning messages will occur.

RESOLUTION

Because these are harmless warnings (that is, connecting was successful), you can ignore the warnings. Keep in mind that the login time-out has no affect on the data source.

MORE INFORMATION

The debug version of MFC version 2.5 can provide TRACE() diagnostics specifically for the database classes. To enable database TRACE() messages, run the TRACER.EXE program. This program can be executed by clicking the "MFC Trace Options" icon in the Microsoft Visual C++ Program Manager group. When the program is displayed, select the check boxes titled "Enable Tracing" and "DB Tracing".

The TRACE() messages shown above occur only if DB Tracing is enabled.


Additional reference words: 1.50 2.50 4.20 error timeout
KBCategory: kbprg kbprb
KBSubcategory: MfcDatabase
Keywords : kb16bitonly MfcDatabase kbprb kbprg
Technology : kbMfc
Version : 1.50 4.20
Platform : WINDOWS


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: July 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.