BUG: CDatabase::ExecuteSQL() Function Does Not Throw Exception with Multiple Result Sets (246165)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q246165 SYMPTOMS When the CDatabase::ExecuteSQL function is called on a stored procedure that creates multiple
result sets, and an error is encountered, an exception may not be thrown. Note,
however, that the exception is thrown only if the error is encountered while
processing the first result set. If the error happens after processing the
first result set, the exception is not thrown.
The "More Information" section has an example of a stored procedure that does not cause
an exception to be thrown. This stored procedure creates two result sets and
calls RAISERROR between them. CAUSE The implementation of the ExecuteSQL function of the CDatabase class throws an exception if an error is encountered during the
execution of the SQLExecDirect function. The function loops through all the remaining result
sets by calling SQLMoreResults, and then exits if it reaches the last result set or if it
encounters an error. The function does not, however, throw an exception if an
error is encountered in a call to SQLMoreResults. RESOLUTION For a workaround, see the "More Information" section.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/31/2003 |
---|
Keywords: | kbbug kbDatabase kbMDACNoSweep KB246165 kbAudDeveloper |
---|
|