_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;