CString qwe;
m_asd.GetWindowText(qwe);
CString str1;//调出下拉列表框中的列名
str1.Format("select * from jibenxinxi where %s like'%%%s%%'",qwe,m_QueryText);
AfxMessageBox(str1);
theApp.command->CommandText=str1.GetBuffer(-1);         recordset=theApp.command->Execute(0,0,1);
m_ListCtrl.SetFocus();
int i;
for(i=0;i<m_ListCtrl.GetItemCount();i++)
{m_ListCtrl.SetItemState(i,NULL,LVIS_SELECTED);}
for(i=0;i<recordset->GetRecordCount();i++)
{
CString zxc=recordset->GetCollect("qwe").bstrVal;
int j;
for(j=0;j<m_ListCtrl.GetItemCount();j++)
{
if(m_ListCtrl.GetItemText(j,1)==zxc)
{m_ListCtrl.SetItemState(j,LVIS_SELECTED,LVIS_SELECTED);}
}
recordset->MoveNext();
}
}
catch(_com_error e)
{
AfxMessageBox(e.Description());
}
确定下拉列表框列名与数据库相同,求大神解答