KVADODBGrid控件提供多条件查询功能,即控件方法SetSqlStringWhere(STRING bstrWhere1,STRING bstrWhere2,STRING bstrWhere3,STRING bstrWhere4,STRING bstrWhere5,STRING bstrWhere6);
下面以查询报警数据库为例:
string whe1;
string whe2;
string whe3;
whe1="AlarmDate='"+\本站点查询日期+"' and VarName='数据1'";
whe2=" or AlarmDate='"+\本站点查询日期+"' and VarName='数据2'" ;
whe3=" or AlarmDate='"+\本站点查询日期+"' and VarName='数据3'" ;
ctrl.SetSqlStringWhere(whe1,whe2,whe3," "," "," ");//可以最多写六个条件,用不到的就用" "代替。
ctrl.FetchData();
ctrl.FetchEnd();