做了一个ADO调用orancle存储过程的测试工程如下:(1)数据源为cyxt,User ID和Password均为cyxt;
(2)p_pda_write_globaldata是orancle的一个存储过程,原形如下:
create or replace procedure p_pda_write_globaldata is
begin
package_server.of_write_globaldata(''); // 这是orancle的包中的
// 存储过程
end p_pda_write_globaldata;
/VC程序为:
HRESULT hr;
_ConnectionPtr m_pConnTemp = theApp.m_pConnection; UpdateData();CString strConnection="Provider=MSDASQL.1;Data Source=cyxt";try
{
hr = m_pConnTemp.CreateInstance("ADODB.Connection"); if(SUCCEEDED(hr))
{
hr=m_pConnTemp->Open((_bstr_t) strConnection,
"cyxt",
"cyxt",
adModeUnknown);
_CommandPtr m_pCommand;
m_pCommand.CreateInstance(__uuidof(Command)) ;
m_pCommand->ActiveConnection =m_pConnTemp ; // 将库连接赋于它
m_pCommand->CommandText = _bstr_t("p_pda_write_globaldata");
m_pCommand->Execute(NULL,NULL, adCmdStoredProc);
}
}
catch(_com_error e)
{
..... // 错误提示
} 运行提示错误为:不支持此接口。但是,对于一些简单的存储过程(例如插入一条记录等),执行是正确的。请问这是什么原因,如何修改?
(2)p_pda_write_globaldata是orancle的一个存储过程,原形如下:
create or replace procedure p_pda_write_globaldata is
begin
package_server.of_write_globaldata(''); // 这是orancle的包中的
// 存储过程
end p_pda_write_globaldata;
/VC程序为:
HRESULT hr;
_ConnectionPtr m_pConnTemp = theApp.m_pConnection; UpdateData();CString strConnection="Provider=MSDASQL.1;Data Source=cyxt";try
{
hr = m_pConnTemp.CreateInstance("ADODB.Connection"); if(SUCCEEDED(hr))
{
hr=m_pConnTemp->Open((_bstr_t) strConnection,
"cyxt",
"cyxt",
adModeUnknown);
_CommandPtr m_pCommand;
m_pCommand.CreateInstance(__uuidof(Command)) ;
m_pCommand->ActiveConnection =m_pConnTemp ; // 将库连接赋于它
m_pCommand->CommandText = _bstr_t("p_pda_write_globaldata");
m_pCommand->Execute(NULL,NULL, adCmdStoredProc);
}
}
catch(_com_error e)
{
..... // 错误提示
} 运行提示错误为:不支持此接口。但是,对于一些简单的存储过程(例如插入一条记录等),执行是正确的。请问这是什么原因,如何修改?
http://www.csdn.net/Develop/Read_Article.asp?Id=7762
http://www.csdn.net/Develop/Read_Article.asp?Id=11663
用你的用户登陆plvdev 看看能不能执行它