用VC调用存贮过程refresh失败,有时第二次不能写成功,且参数数量不对
如题,用VC调用存贮过程时,代码如下:
m_pCommand->ActiveConnection=m_pConnection;
m_pCommand->CommandType=adCmdStoredProc;
m_pCommand->CommandText="pDeviceOnLine";//存贮过程名
_ParameterPtr m_pParam;
m_pParam.CreateInstance("ADODB.Parameter");
m_pParam=m_pCommand->CreateParameter("device",adVarChar,adParamInput,20,(_variant_t)tempid);
m_pCommand->Parameters->Append(m_pParam);
m_pCommand->Execute(NULL,NULL,adCmdStoredProc);
结果发现第一次成功,以后失败.
认为是parameter没清空,加了
m_pCommand->Parameters->Refresh();
或
m_pCommand->Parameters->Release();
都不行.单步运时时,发现运行到refresh或release时有
Loaded 'C:\Program Files\Common Files\System\msadc\msadce.dll', no matching symbolic information found.
不知道是否与它有关
在前面加了查参数数量的代码
int icount=m_pCommand->Parameters->Count;
发现从未加时icount是6
当然后面执行execute失败.
本人万分焦急,网上遍寻解决方法结果无效.恳请各位大侠施手援救,不胜感激之至.