64,654
社区成员
发帖
与我相关
我的任务
分享
bool CADOBase::ExecuteCommand(const _bstr_t& CmdText, CSafeLogSize* log)
{
try
{
VARIANT affect;
affect.vt = VT_I4;
affect.lVal = adAffectCurrent;
if (log)
{
log->Write("%s", (LPCSTR)CmdText);
}
m_pConnection->Execute(CmdText, &affect, adCmdText);
if (log)
{
log->Write("调用Execute后");
}
}
catch (_com_error& e)
{
UNREFERENCED_PARAMETER(e);
if (log)
{
log->Write("%s", (LPCSTR)e.Description());
}
return false;
}
catch(...)
{
if (log)
{
log->Write("不知名异常");
}
return false;
}
return true;
}