恩,是啊,就是m_preTime的值,我用的VC,QueryDirect函数如下
long CDbWaitor::QueryDirect(CString strQuery)
{
long plState;
try
{
pRecordset->get_State(&plState);
if(plState == adStateOpen)
pRecordset->Close();
pRecordset->CursorLocation = adUseClient;
pRecordset->Open(_bstr_t(strQuery),pConn.GetInterfacePtr,
adOpenDynamic, adLockOptimistic,adAsyncFetch);
}
catch (_com_error &e)
{
m_strLastErr.Format("%s",e.Description());
return 0/*STAT_FAIL*/;
}
catch (...)
{
return 0;
}
return 1;
}
成功的查询如下
strSql.Format("select alarmGrade, alarmTime, ipaddr, name, alarmCond, alarmValue, "
" affirmStatus, alarm_info.id, workedStatus from alarm_info, protocol "
" where alarm_info.sevice=protocol.port "
" order by alarm_info.id desc " );
if(FALSE == g_dbWaitorBack.QueryDirect(strSql))
{
return;
}
又得麻烦你了,呵呵,真不好意思