Solved

stored procedures

Posted on 1998-11-25
2
200 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
Comment Utility
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
Comment Utility
if i want to call stored procedures using Ole DB how do i do it ?
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

744 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

12 Experts available now in Live!

Get 1:1 Help Now