I.T. Discussion Community!
-Collapse +Expand
DBA
Search DBA Group:

Advanced
-Collapse +Expand DBA Store
PRESTWOODSTORE

Prestwood eMagazine

March Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyDBA, Databases, & Data BoardMS SQL Topic   Print This     

Calling SQL Server 7 Stored Procedures from C++

Calling SQL Server 7 Stored Procedures from C++ in MS SQL topic (part of our DBA, Databases, & Data group).

Quick Search: Calling   Procedures   Calling SQL   Calling SQL Server   7 Stored   Procedures C  
andyhud
 (Inactive)
Fleet, Surrey, England
I am having trouble calling a SQL Server 7.0 Stored Procedure from C++ that returns a recordset and an output parameter.

Here's the criteria - I wish to bind parameters at run time and I need to return an output parameter. Presumably, I need to use rs.Open not execute in order to get the recordset - the problem is that I don't get the output parameters if I am opening the recordset.
The stored procedure may change so I don't really want to implement a static wrapper for it.
I have tried to implement this with ADO, MFC DAO and MFC ODBC support classes.

A sample piece of code that does exactly what I need would be ideal...
 Posted 20 years ago (Thread Starter)
Comment Quote
About andyhud -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #1994, 3 replies
Thread Started 5/3/2001 10:13:00 PM
View Counter=4119
Last Reply Posted 9/27/2002 4:49:00 PM)
Location=Fleet, Surrey, England  
Joined=20 years ago   MB Posts=14  
andyhud
 (Inactive)
Fleet, Surrey, England
Thanks for your reply VBcrew but I'm afraid that won't return me a recordset which is why open is used rather than execute.
 Posted 20 years ago (Thread Starter)
Comment Quote
About andyhud -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #2975 (Level 1.1)  Reply to 1994
Thread Started 7/13/2001 12:51:00 AM
View Counter=2
Location=Fleet, Surrey, England  
Joined=20 years ago   MB Posts=14  
VBcrew
LA
I did that on VB so I would like to try. I would use rs.execute instead. Code will like this:
..... rs.parameter(0)= somthing
rs.parameter(1)=somthing /suppose rs.parameter(1) is the return parameter./
rs.execute
print rs.parameter(1)
rs.close
The code is different from C++/DAO/ADO because I am using VB and RDO but you get the idea...
 Posted 20 years ago
Comment Quote
About VBcrew -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #2970 (Level 1.2)  Reply to 1994
Reply Posted 7/12/2001 3:57:00 PM
Location=LA  
Joined=20 years ago   MB Posts=6  
Most Recent Post
VBcrew
LA
It will work, It will work. I try it before.
 Posted 19 years ago
Comment Quote
About VBcrew -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #7716 (Level 1.3)  Reply to 1994
Reply Posted 9/27/2002 4:49:00 PM
Location=LA  
Joined=20 years ago   MB Posts=6  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P123A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #1994 Counter
4119
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2021 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech