国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

通用查詢組件設計(續四)

2019-11-18 18:23:46
字體:
來源:轉載
供稿:網友

通用查詢組件設計

作者:nxyc_twz@163.com

  前段時間由于工作較忙,無暇整理本組件的相關文檔,請大家諒解!以后我會陸續整理公布該組件的所有相關文檔及源碼

設置字段變量

PRocedure TMyFieldInfo.SetVariables(d: TDataset);

var

  value : String;

begin

//設置變量值

  if AnsiUpperCase(FilterValue) = 'NULL' then

    exit;

  if FieldType = ftString then

  begin

    if CaseSensitive then

      case MatchType of

        fdMatchStart, fdMatchAny :

          value := FilterValue;

        fdMatchEnd :

          value := '%' + FilterValue;

        fdMatchExact :

          value := FilterValue;

      end

    else

      case MatchType of

        fdMatchStart, fdMatchAny :

          value := AnsiUpperCase(FilterValue);

        fdMatchEnd :

          value := '%' + AnsiUpperCase(FilterValue);

        fdMatchExact :

          value := AnsiUpperCase(FilterValue);

      end;

  end

  else

    value := FilterValue;

  if d is TDataSet then

  begin

    if MatchType <> fdMatchRange then

      TQuery(d).ParamByName(FieldName + 'Filter').Value :=  value

    else

    begin

      if CaseSensitive then

      begin

        if StartingValue <> '' then

          TQuery(d).ParamByName(FieldName + 'Start').Value := StartingValue;

        if EndingValue <> '' then

          TQuery(d).ParamByName(FieldName + 'End').Value := EndingValue;

      end

      else

      begin

        if StartingValue <> '' then

          TQuery(d).ParamByName(FieldName + 'Start').Value := AnsiUpperCase(StartingValue);

        if EndingValue <> '' then

          TQuery(d).ParamByName(FieldName + 'End').Value := AnsiUpperCase(EndingValue);

      end;

    end;

  end

  else

  begin

    if MatchType <> fdMatchRange then

      TQuery(d).ParamByName(FieldName + 'Filter').Value :=  value

    else

    begin

      if CaseSensitive then

      begin

        if StartingValue <> '' then

          TQuery(d).ParamByName(FieldName + 'Start').Value := StartingValue;

        if EndingValue <> '' then

          TQuery(d).ParamByName(FieldName + 'End').Value := EndingValue;

      end

      else

      begin

        if StartingValue <> '' then

          TQuery(d).ParamByName(FieldName + 'Start').Value := AnsiUpperCase(StartingValue);

        if EndingValue <> '' then

          TQuery(d).ParamByName(FieldName + 'End').Value := AnsiUpperCase(EndingValue);  

      end;

    end;

  end

end;

 

定義參數變量類

TDBVariable = class  //參數數據變量

  public

    VariableName : String;  //變量名 

    VariableValue : Variant;  //變量值

    constructor Create(name : String; value : Variant); //構造函數

  end;

 


上一篇:從數據庫繪制MapX地圖

下一篇:通用查詢組件設計(續三)

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
學習交流
熱門圖片

新聞熱點

疑難解答

圖片精選

網友關注

主站蜘蛛池模板: 杭锦旗| 景洪市| 屯昌县| 大英县| 祁门县| 梁河县| 崇阳县| 肇东市| 攀枝花市| 遂溪县| 苍山县| 潞西市| 宜宾县| 新晃| 连山| 耒阳市| 澄城县| 绥江县| 奉新县| 特克斯县| 常熟市| 洪湖市| 安多县| 卓资县| 永靖县| 左云县| 海盐县| 延寿县| 翁牛特旗| 偃师市| 道孚县| 南江县| 旬阳县| 巴里| 偃师市| 八宿县| 甘谷县| 太和县| 阜新市| 日土县| 乌兰察布市|