Store Procedure in VC++ 
Author Message
 Store Procedure in VC++

I am working on call ORACLE Store Procedure from VC++, I have this in VB.
But no clear directrion how to do in VC++ using ODBC(Or ADO).I need pass one
parameter and get one parameter back.

Please email or post the source sample code if you have done this
before!

Thank you in advance.

Mark Wu



Tue, 24 Aug 2004 13:03:23 GMT  
 Store Procedure in VC++
Hello,

The following is a code snippet for your reference:

// ----------------code snippet----------------------
_CommandPtr cmmd;
HRESULT hr = cmmd.CreateInstance(__uuidof(Command));

if(FAILED(hr))
{
   ...

Quote:
}

_ParameterPtr param;
param = cmmd->CreateParameter(....., adParamInput, ...);
cmmd->Parameteres->Append(param);

param = cmmd->CreateParameter(...., adParamOutput, ...);
cmmd->Parammeters->Append(param);

cmmd->CommandText=_bstr_t("Procedure Name");
cmmd->ActiveConnection = m_pConPtr; // The ADO connection
cmmd->CommandType = adCmdStoredProc;

cmmd->Execute(NULL, NULL, adCmdStoredProc);
m_out = cmmd->Parameters->GetItem("Output param name")->GetValue();
// -------------------end if snippet------------------------------

Hope this helps.

Regards,
Max
==========================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

|Newsgroups: microsoft.public.vc.database
|Subject: Store Procedure in VC++

|X-Tomcat-NG: microsoft.public.vc.database
|
|I am working on call ORACLE Store Procedure from VC++, I have this in VB.
|But no clear directrion how to do in VC++ using ODBC(Or ADO).I need pass
one
|parameter and get one parameter back.
|
|Please email or post the source sample code if you have done this
|before!
|
|Thank you in advance.
|
|Mark Wu
|



Fri, 27 Aug 2004 15:31:16 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Stored Procedures through VC 5.0

2. Problems debugging stored procedures from VC++ 5.0

3. calling a stored procedure from VC++

4. ADO : OUTPUT VALUE from a Stored procedure in VC++

5. How do I call a stored procedure in VC++

6. Calling Oracle stored procedure from VC++

7. Newbie: Looking for simplest code to call a sybase stored procedure from VC++

8. ADO stored procedures from VC++ using ORACLE

9. Problems calling Oracle stored procedures from VC++ over ADO(OLEDB)

10. stored procedures with VC++

11. Run Store Procedure from VC++

12. How to call stored procedure from VC++?

 

 
Powered by phpBB® Forum Software