PRB: TRACE() Messages Displayed When Opening Database

ID: Q112823


The information in this article applies to:


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 query words: 1.50 2.50 4.20 error timeout


Keywords          : kb16bitonly kbDatabase kbMFC kbODBC kbVC 
Version           : 1.50 4.20
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: August 2, 1999