ADO连接Access数据库后执行SQL语句报错!
我的代码是这样的 在Access数据库中有个字段是整型的tsendByte 想通过后面的条件来求和
strSQl.Format("select SUM(tsendByte) as totalsend from dataname where roverusername='%s' and dateTimeA>=#%s# and dateTimeA<=#%s# ",roveruserName,startime,stoptime);
try
{
m_pRecordset->Open(_bstr_t(strSQl),
m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
}
catch (_com_error *e)
{
AfxMessageBox(e->ErrorMessage());
}
报如下错误:Unhandled exception in xxx.exe:0xC0000005:Access violation
然后点击确定后出现V_DISPATCH(this)->AddRef();
向各位请教下。