MDAC 2.5 SDK - ODBC Programmer's Reference
Chapter 9: Executing Statements
When an error occurs while executing a batch of SQL statements, one of the following four outcomes are possible. (Each possible outcome is data source–specific and might even depend on the statements included in the batch.)
In the first two cases, SQLExecute and SQLExecDirect return SQL_ERROR. In the latter two cases, they may return SQL_SUCCESS_WITH_INFO or SQL_SUCCESS, depending on the implementation. In all cases, further error information can be retrieved with SQLGetDiagField, SQLGetDiagRec, or SQLError. However, the nature and depth of this information is data source–specific. Furthermore, this information is unlikely to exactly identify the statement in error.