各位高手帮我看看~~我定义了一个列表控件,用的时候人家说找不到

wu14245670 2009-08-07 02:08:54
各位高手帮我看看~~我定义了一个列表控件,用的时候人家说找不到

类里定义

public:
//{{AFX_DATA(CUBARGAIN)
enum { IDD = IDD_UBARGAIN_FORM };
CComboBox m_Date;
CComboBox m_Dateto;
CEdit m_Uname;
CEdit m_Floor;
CControl m_Grid;

实现查询

void CUBARGAIN::OnButnQuery()
{
CString SelectWords ="id,name,floor,bargaindate";
CString sql="Select"+SelectWords+"from UserBargaining where 0=0";
CString username;
m_Uname.GetWindowText(username);
if(Trim(username)!="")
{
sql+=("And username='"+username+"'");
}
CString floor;
m_Floor.GetWindowText(floor);
if(Trim(floor)!="")
{
sql+=("And floor='"+floor+"'");
}
CTime time,timeto;
CString timeSrc=time.Format("%Y-%m-%d");
CString timetoSrc=timeto.Format("%Y-%m-%d");
m_Date.GetWindowText("timeSrc");
m_Dateto.GetWindowText("timetoSrc");
CString timeStr=time.Format("%Y-%m-%d");
CString timetoStr=time.Format("%Y-%m-%d");
if(timeStr!=timeSrc && timetoStr!=timetoSrc)
{
sql += " And format(UserBargaining.bargaindate,'yyyy-mm-dd') >='" + timeStr + "' And format(UserBargaining.bargaindate,'yyyy-mm-dd') <='" + timetoStr + "'";
}

sql+="Order by UserBargaining.bargaindate desc";
m_Grid.SetRecordsetToGrid(sql);


}
...全文
63 点赞 收藏 1
写回复
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
菜牛 2009-08-07
哪个“人家”?
回复
发动态
发帖子
VC/MFC
创建于2007-09-28

1.5w+

社区成员

VC/MFC相关问题讨论
申请成为版主
社区公告
暂无公告