Solved

stored procedures

Posted on 1998-11-25
2
201 Views
Last Modified: 2010-04-01
how do i invoke stored procedures written in SQL Server,
in VC++ ?
0
Comment
Question by:chari112598
2 Comments
 
LVL 1

Accepted Solution

by:
perrizo earned 20 total points
ID: 1178651
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
 

Author Comment

by:chari112598
ID: 1178652
if i want to call stored procedures using Ole DB how do i do it ?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Handling string inputs in C/Linux 23 179
cb: unreferenced local variable 11 72
C++ Language error 28 197
IdTCPClient1->Disconnect(); not working 3 61
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now