On VC++6.0, CRecordset::Open method fails with an exception error : "Attempt
to open a table failed - there were no columns to retrieve were specified."
Inside the MFC code, CRecordset::BuildSelectSQL() method fails :
"ThrowDBException(AFX_SQL_ERROR_EMPTY_COLUMN_LIST);"
I have noticed an issue in the BuildSelectSQL) method.
at this line :
// Ignore queries with procedure call keyword or output param
if (!(_tcsnicmp(m_strSQL, _afxCall, lstrlen(_afxCall)-1) == 0 ||
_tcsnicmp(m_strSQL, _afxParamCall, lstrlen(_afxParamCall)-1) == 0))
In this case, a procedure exec keyword is not ignore.
It works with CALL keyword and not with EXEC[UTE] keyword.
If it doesn't, then use CDatabase::ExecuteSQL().
If it does, then the CRecordset-derived class requires some bound
fields to place the results into. Take a look at my article on
CodeProject (http://www.codeproject.com/KB/database/CountSet.aspx),
which'll give you some ideas of where to put the code.
HTH
Paul.