SQL查询表达式构造问题,请高手帮忙指导 用PutCollect函数,一个字段一个字段的赋值 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你是用ado连接数据库的吗?m_pRecordset->AddNew(); m_pRecordset->PutCollect("Num", _variant_t(m_nuber)); m_pRecordset->PutCollect("Name", _variant_t(m_name)); m_pRecordset->PutCollect("Sex", _variant_t(m_sex)); m_pRecordset->PutCollect("Grade", _variant_t(m_Grade));.......... m_pRecordset->Update(); 是用ADO连的,那这样是不是把值存到数据库里啦,不是查询吧? 这个问题很典型,可以用下面这种形式来处理(大部分都是这样)CStirng strSql = "select * from table where 1=1 ";if(strUserName.GetLength() > 0 ){ strSql += "and 用户名 = '张三';}...我应该表达出来了 strwhere =" where 1=1 " strCondition += "and name = '张三'" strwhere += strCondition; 本人delphi准高手,问几个vc问题 两个函数之间的调用 怎麼樣在CListCtrl第一列中加入組合框,第二列加入文本框 用VC如何开发像QQ游戏那种绚丽的界面? 如何防止目录被改名或移动? WINDOWS与BIOS XML智能化结构解析,大家帮我一下 学习 字体前面有“@”表示什么意思? 用teechart控件画曲线后,需要打印,如果数据很多,分了很多页,怎么样让它打印出来的时候也是可以分页的? CString的GetBuffer问题~ c++中,this指针指向什么?我这个程序老报错,请高手看下!
m_pRecordset->AddNew();
m_pRecordset->PutCollect("Num", _variant_t(m_nuber));
m_pRecordset->PutCollect("Name", _variant_t(m_name));
m_pRecordset->PutCollect("Sex", _variant_t(m_sex));
m_pRecordset->PutCollect("Grade", _variant_t(m_Grade));
..........
m_pRecordset->Update();
CStirng strSql = "select * from table where 1=1 ";
if(strUserName.GetLength() > 0 )
{
strSql += "and 用户名 = '张三';
}
...
我应该表达出来了
strCondition += "and name = '张三'"
strwhere += strCondition;