[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

stored procedures

Posted on 1998-11-25
2
Medium Priority
?
210 Views
Last Modified: 2010-04-01
how do i invoke stored procedures written in SQL Server,
in VC++ ?
0
Comment
Question by:chari112598
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
perrizo earned 60 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

650 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