當前位置:編程學習大全網 - 網站源碼 - vc可以調用plsql函數或者存儲過程嗎?

vc可以調用plsql函數或者存儲過程嗎?

肯定可以,壹下是哥寫的

_ParameterPtr parm[3];

bool flag=false;

try

{

int v_return=0;

OnInitADOConn();

m_pcommand.CreateInstance(__uuidof(Command));

m_pcommand->ActiveConnection=m_pConnection;

m_pcommand->CommandText=_bstr_t(L"UserLogin");

m_pcommand->CommandType=adCmdStoredProc;

parm[0]=m_pcommand->CreateParameter("P_EMPNO",adInteger,adParamInput,4,_bstr_t(empno));

parm[1]=m_pcommand->CreateParameter("P_ENAME",adVarWChar,adParamInput,10,_bstr_t(password));

parm[2]=m_pcommand->CreateParameter("P_FLAG",adInteger,adParamOutput,1);

for(int i=0;i<3;i++)

m_pcommand->Parameters->Append(parm[i]);

m_pcommand->Execute(0,NULL,adCmdStoredProc);

v_return = (int)m_pcommand->Parameters->GetItem("P_FLAG")->GetValue();

m_pcommand->Parameters->Delete(L"P_EMPNO");

m_pcommand->Parameters->Delete(L"P_ENAME");

m_pcommand->Parameters->Delete(L"P_FLAG");

if(v_return==1)

{

flag=true;

}

ExitConnect();

}

catch (_com_error e)

{

flag=false;

}

return flag;

  • 上一篇:中興智能機頂盒b860av1.1鏈接epg服務失敗。
  • 下一篇:EA的uml工具中某些參與者的生命線被分成幾段是什麽意思?如何實現細分?
  • copyright 2024編程學習大全網