MFC, Exec Stored Procedure - SQL DB
Posted on 1998-11-30
I am trying to read info from SQL server DB using the stored procedures. I have created a class derived from CRecordset using MFC, opened it using Open fn. Here is the code,
CString csSql = "exec StoredProcedureName" ;
CDatabase dbMyDB ;
CMyRecordSet cMyRSet(&dbMyDB) ;
cMyRSet.open(CRecordset::snapshot, csSql) ;
Navigate the result set....
I am getting the RunTime error(not the compile time error).
"Incorrect Syntax near the keyword exec"
Do you have any idea? Whats wrong?