一运行ado 连接存储过程 HResult _hr = get_ActiveConnection(&result)就会中断 神马原因,该如何解决
一运行ado 连接存储过程 HResult _hr = get_ActiveConnection(&_result)就会中断 神马原因
pConn = CDbFactory::NewConnection();
if(pConn == NULL)
{
return FALSE;
}
_CommandPtr pCommand = pConn->GetCommandPtr();
pCommand->Parameters->Refresh();
pCommand->ActiveConnection = pConn->GetConnPtr();(中断了)
求教 原因!!!
------解决方案--------------------
加异常捕获看是什么错误
pConn = CDbFactory::NewConnection();
if(pConn == NULL)
{
return FALSE;
}
_CommandPtr pCommand = pConn->GetCommandPtr();
pCommand->Parameters->Refresh();
pCommand->ActiveConnection = pConn->GetConnPtr();(中断了)
求教 原因!!!
------解决方案--------------------
加异常捕获看是什么错误
try
{
//你的ADO代码
}
catch (_com_error& e)
{
CString strMsg;
strMsg.Format(_T("错误描述:%s\n错误消息%s"),
(LPCTSTR)e.Description(),
(LPCTSTR)e.ErrorMessage());
AfxMessageBox(strMsg);
}