• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • 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

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

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