Microsoft
Software
Hardware
Network
Question : calling oracle stored procedues from VC++ using ADO
Hello,
I am using VC++ 6.o and trying to call oracle stored procedures with ADO.
I have attached the below code which is executed after establishing a connection with the database using a ODBC driver.
this code throws an exception when i am trying to retrieve the record set.
also can u suggest some sites/books anything else for my reference.
the procedure "spproc" is as below:
/**********************
create procedure spproc
num number;
begin
select bay_no into num from bay_dtl where rownum =1;
end;
/*****************
the bay no is an integer in the bay_dtl table.
/*********code*********
try
{
_CommandPtr pCommand;
_ParameterPtr pParam1;
HRESULT hr = pCommand.CreateInstance (__uuidof (Command));
if (FAILED (hr))
{
AfxMessageBox ("Can't create an instance of Command");
return;
}
pCommand->ActiveConnection
= m_pConn;
pCommand->CommandText = "spproc";
pCommand->CommandType = adCmdStoredProc;
_RecordsetPtr pRecordset;
hr = pRecordset.CreateInstance (__uuidof (Recordset));
if (FAILED (hr))
{
AfxMessageBox ("Can't create an instance of Recordset");
return;
}
pRecordset = pCommand->Execute(NULL,NUL
L,adCmdSto
redProc);
CString strContent;
/* throws an exception here
strContent = (char *) (_bstr_t) pRecordset->Fields->GetIte
m ("bay_no")->Value;
AfxMessageBox(strContent);
}
thanks in advance
Answer : calling oracle stored procedues from VC++ using ADO
http://govt.oracle.com/~tk
yte/Result
Sets/index
.html
What version of ORACLE?
It looks as if you'll need ORACLE 8 or higher.
Random Solutions
CREATE AN MSDOS BOOT CD FOR ACRONIS, KNOPPIX, GHOST, WINDOWS XP REPAIR CONSOLE!
Access Pivot chart - need different scales on right and left axis
RUNDLL error message "jyku.fjo" on computer start up
MISSING: Microsoft Windows Common Controls - 2 6.0 (SP3)
Textboxes in other Tabs in asp.net
XP display set to 4 bit color depth after Remote Desktop session
Using SaveAs in excel 2007 vba
Changing a field type while using INTO
Loop.sys
Scheduled Task creation with VBscript