I'm trying to execute a stored procedure on SQL Server from an MFC based C++ program. The stored procedure does get executed properly, but an exception is thrown in my program, a CDBException with a message of "Function sequence error". Tracing through the MFC source code for CRecordset::Open, the exception is thrown from MoveNext - this makes sense, as my stored procedure isn't generating any output.
I have both input and output parameters to the stored procedure, so I can't use CDatabase::ExecuteSQL as suggested in this question: http://stackoverflow.com/questions/839739/with-cdatabase-can-i-send-sql-without-using-crecordset