循环获取Query中的查询条件,过滤条件

void getSearchingCriteria(Query _q)
{
    int i,j,curFieldID;

    str   curPname ;
    str   curRangeValue;
    ;

    for (i=1; i<= _q.dataSourceCount(); i++)
    {
        for (j=1;j<= _q.dataSourceNo(i).rangeCount();j++)
        {
            if (_q.dataSourceNo(i).range(j).value())
            {
                curRangeValue = _q.dataSourceNo(i).range(j).value();
                CurFieldID=fieldname2ID(_q.dataSourceno(i).table(),_q.dataSourceNo(i).range(j).name());
                if (CurFieldID != fieldnum(ProdTable,Act_ProdCancelId))
                {
                    CurPName=FieldID2PName(_q.dataSourceno(i).table(),curFieldID);
                    selectCriterial +=curPName +' : '+curRangeValue+'\n';
                }
            }
       }
    }

}

posted @ 2011-10-24 11:39  perock  阅读(501)  评论(0编辑  收藏  举报