Stored procedures and MFC
Hi everyone,
I spend the whole night trying to make this work, but no luck! Maybe someone can help me out. I am literally pulling hairs out of my head.
I have the following SQL Stored procedure.
CREATE PROCEDURE UpdateTestVorgaenge
@TestName nVARCHAR(250),
@OutID int OUTPUT
AS
INSERT INTO Temp_TestVorgaenge_t (Name, Datum) values(@TestName, CURRENT_TIMESTAMP)
Select @OutID= @@IDENTITY
Now, I have a CRecordSet derived class and I want to use that to call this stored procedure.
here is what I do:
void DoFieldExchange(CFieldExchange* pFX)
{
pFX->SetFieldType(CFieldExchange::param);
RFX_Text(pFX, _T("TestName"), m_name);
pFX->SetFieldType(CFieldExchange::inoutParam);
RFX_Int(pFX, _T("OutID"), m_testVID);
}
And my Open statement looks like this...
CRecordset::Open(dynaset, _T("{CALL UpdateTestVorgaenge(?,?)}"), CRecordset::none);
But it throws an exception saying "Function Sequence error". Anyone has any ideas on how to make this work???
Thanks,
Sincerely yours,
Pankaj
|