Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Catastrophic Failure" message while connecting to DB2

Status
Not open for further replies.

akterali

Programmer
Oct 23, 2002
3
SG
I am using ADO to connect to DB2 via an ODBC DSN from an application program written in VC++ 6.0/MFC. I call ADODB::Connection::OpenSchema method to get the list of tables. After that I iterate through the returned TABLES Rowset to retrieve the list of table names and the list of fields in each table. At this point I get the following _com_error exception:

Error: Catastrophic Failure
Source: Microsoft OLE DB Service Components
Description: Catastrophic Failure

Microsoft has confirmed this error in ODBC driver for SQL Server in the following MSDN article:

0x8000FFFF "Catastrophic failure" Message with SQL Server ODBC Driver

But for DB2 I have no such authentic information. Can any body help asap.
 
Are you connecting to DB2 on the mainframe or to some other platform? Sounds like there is a possible problem with how ODBC is reading the DB2 Catalog. I assume you can connect and do queries successfully outside of your program via the DB2 Command Center or MS ACCESS or something?
Anyway, the first place to start would be to turn on ODBC tracing and find the offending SQL statement; this will probably be the last one. If you post this, we can probably help you (crossing fingers).

Cya
 
Thanks Shaixpeare for your comment. I am new to DB2 and do not know how to turn on ODBC tracing. However I have debugged my code and the result is as follows: When I debug the code the problem does not seem to occur. When I just run the program it occurs. Also the problem does not occur everytime. Please see below excerpt from an MSDN article where Microsoft has stated the cause of this problem in SQL Server ODBC Driver:

CAUSE
The Microsoft SQL Server ODBC driver is loading the Winmm.dll file for timing functions. While Winmm.dll is primarily a multimedia DLL, it contains some timing functions that resolve down to the millisecond level, and the Microsoft SQL Server ODBC driver is using these functions for internal timing issues.

In the 3.70.0690 build of the Microsoft SQL Server ODBC driver, Winmm.dll is being unloaded prematurely, and the function pointers are not being zeroed out. Therefore, the function pointer appears to refer to a valid address but the location it points to in memory is no longer valid.

This access violation (AV) is being caught by the exception handling in the OLE DB Service Components, and an 0x08000FFFF "Catastrophic failure" message is then returned to the client.

My guess is that the ODBC Driver for IBM DB2 has the similar problem. Is there any note from IBM on this issue. Please let me know. Thank you again.
 
I have finally resolved the DB2 connection error. The problem was with the OLE DB Provider for IBM DB2. According to Microsoft OLE DB specification, the TABLES Rowset must contain TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE columns. If any provider does not support TABLE_CATALOG or TABLE_SCHEMA, it should return NULL in this column. The OLE DB Provider for IBM DB2 does not support TABLE_CATALOG. But instead of returning NULL in the TABLE_CATALOG column, it does not at all include the column in the TABLES rowset object. As I was querying the value for this inexisting column in the code, it was giving exception.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top