CString strUser;
int nIndex = m_ctrlUser.GetCurSel();
if (CB_ERR != nIndex)
m_ctrlUser.GetLBText(nIndex,strUser);
if(strUser.IsEmpty()) return;
ADOConn m_AdoConn;
m_AdoConn.OnInitADOConn();
CString sql;
sql.Format(_T("SELECT tbrz.sj,tbrz.czy,tbrz.nr FROM tbrz where czy='%s' and sj between CDate('%s %s') and CDate('%s %s')"),
strUser,
dtStartDate.Format(_T("%x")), dtStartTime.Format(_T("%X")),
dtEndDate.Format(_T("%x")), dtEndTime.Format(_T("%X")));
TRACE(sql);
int i = 0;
_RecordsetPtr pRecordset;
pRecordset = m_AdoConn.GetRecordset((_bstr_t)sql);
m_wndList.DeleteAllItems();
while (!pRecordset->adoEOF)
{
CString str;
str.Format(_T("%d"), i);
m_wndList.InsertItem(i, str);