The information in this article applies to:
SYMPTOMSWhen you use the "Call" syntax to invoke a stored procedure when opening a recordset, an exception might be thrown. Depending upon the version of Visual C++, whether or not you have DB Tracing enabled and the DBMS in use, you might see one of the following errors:
NOTE: If you are using Visual C++ 1.5X and connecting to a 16-bit SQL
Server datasource, an exception may not be thrown but the desired result
set is not returned.
CAUSEWhile this line of code may appear to be a perfectly valid way to invoke a stored procedure, there is a small error: The space between the "{" and the "C" cause MFC to misinterpret the Call statement as the name of a table. MFC makes a case insensitive comparison between any SQL provided in the Open() call and the literal constant szCall, which is defined as _T("{call "). If the comparison fails, the provided SQL is incorrectly incorporated into a SELECT statement that is executed instead of the stored procedure call. RESOLUTIONMake sure that there are no extra spaces between the first curly brace and the "Call" key word. STATUSThis behavior is by design. Additional query words:
Keywords : kbDatabase kbMFC kbODBC kbVC |
Last Reviewed: July 26, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |