Hello,
I have a very simple stored procedure:
Code:
CREATE PROCEDURE sp_getcurrentmonth
AS SELECT TOP 1 month_id FROM lockdown_schedule WHERE lockdown_date + 7 > GETDATE() ORDER BY lockdown_date asc
GO
When I execute the procedure in the query analyzer, it returns 1 row with the number I'm expecting.

However when I use the CRecordset open:
m_rs.Open(CRecordset::forwardOnly,"EXECUTE sp_getcurrentmonth",CRecordset::executeDirect|CRecordset::readOnly)
it crashes. Running through the debugger I can see that this is because m_nFields is 0.

Am I missing a step here? Why would the number of fields be zero? it should be one.