• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

stored procedures

how do i invoke stored procedures written in SQL Server,
in VC++ ?
0
chari112598
Asked:
chari112598
1 Solution
 
perrizoCommented:
Hi,

You can simply pass a sql string to a CDatabase object using the ExecuteSQL(CString strSql) function.  

CDatabase db;
CString strSql = _T("{CALL dbName.dbOwner.proc(parameters)}");
db.ExecuteSQL(strSql);

It should look something like the above code... where dbName is the name of your database, dbOwner is the owner of the stored procedure adn parameters are any values you have to pass to the procedure seperated by commas.  Good luck.
0
 
chari112598Author Commented:
if i want to call stored procedures using Ole DB how do i do it ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now