咨詢電話: 400-898-5151
        料中心 DOWNLOAD
        在組態王中使用KVADODBGrid控件進行數據庫查詢時,查詢條件很多,而組態王的字符串變量只支持128個字符,查詢條件寫不下怎么?
        時間:2018-08-16 瀏覽次數:2259

        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();


        -->