Stored procedures

From: (wrong string) üri Loosme <loosme_at_iks.se>
Date: 1997/12/10
Message-ID: <01bd055b$726ab300$56b6f482_at_win95.swipnet.se>#1/1


Hello

To speed upp some database processing I would like to use the class CRecordset, or a derived class, to call a stored procedure which is defined in a SQL Server 6.5 database.
In the documentation of CRecordset it says that I could use a string like "{call sp_my_stored_procedure}" in the Open-function. This works fine when no parameters are needed to the SP. But when I try to use an SP which needs parameters like "{call sp_my_other_proc 127}", an exception is thrown with a message like 'syntax error or invalid access. Since I do have permission to execute the SP I really dont't know what is wrong. My code looks something like this:

try
{
  CMyRecordset rec( &m_Db );
  rec.Open( CRecordset::snapshot, "{call myproc}" ); // this works fine
// do some stuff...

  rec.Close();

  CMyRecordset2 rec2( &m_Db );
  rec2.Open( CRecordset::snapshot, "{call myotherproc 127}" ); // Does NOT work
// do some other stuff

  rec2.Close();
}
catch( CDBException* e)
{
// Error handling

}

Can anyone help me out here ?

:-) Jüri Received on Wed Dec 10 1997 - 00:00:00 CET

Original text of this message