void CMyATLOLEDBDlg::OnButtonAll()
{
ShowItem("");
}
void CMyATLOLEDBDlg::OnButtonSearch()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if (m_cmbCondition.GetCurSel() == CB_ERR)
return;
CString strCondition, strFilter;
m_cmbCondition.GetWindowText(strCondition);
if(strCondition=="姓名")
strFilter.Format(" Name Like '%s%s%s'", "%", m_strQuery, "%");
else if(strCondition=="电话")
strFilter.Format(" Phone Like '%s%s%s'", "%", m_strQuery, "%");
else if(strCondition=="邮件")
strFilter.Format(" Email Like '%s%s%s'", "%", m_strQuery, "%");
else if(strCondition=="地址")
strFilter.Format(" address Like '%s%s%s'", "%", m_strQuery, "%");
else if(strCondition=="邮编")
strFilter.Format(" postcode Like '%s%s%s'", "%", m_strQuery, "%");
ShowItem(strFilter);
UpdateData(FALSE);
}