如果存储过程 需要花费的时间很长的话,Query这个函数就会没有处理就推出来。我该怎么样写这个函数, 才能 让它得到正常的数据集
BOOL CDriveViewerDlg::Query(LPCTSTR lpSQL)
{
_variant_t RecordsAffected;
m_pCmd.CreateInstance(__uuidof(Command));
try
{
if (m_pConnection->State)
;
else
m_pConnection->Open((LPCTSTR)m_strConnection,"","",adModeUnknown);

m_pCmd->ActiveConnection = m_pConnection;
m_pCmd->CommandText = lpSQL;
m_pCmd->CommandType = adCmdStoredProc;

m_pRs = m_pCmd->Execute(NULL, NULL, adCmdText);

//m_pCmd->Release();
//m_pCmd.Detach();
}
catch (_com_error &e)
{
CString str = _T("Database process failed:") + (CString)lpSQL;
return FALSE;
}

return TRUE;
}