设为首页】 【加入收藏】 【网站地图】 【商品折扣
娱乐一生 娱乐明星
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
首页  |  java  |  .NET  |  C/C++  |  网页技术  |  php  |  asp  |  delphi  |  VC  |  VB开发  |  游戏开发  |  软件工程  |  Power Builder  |  Linux开发  |  Windows开发技巧
当前位置:首页 >> delphi >> 通用查询组件设计(续四)_Delphi教程_src119.com

通用查询组件设计(续四)_Delphi教程_src119.com -

通用查询组件设计

作者:nxyc_twz@163.com

  前段时间由于工作较忙,无暇整理本组件的相关文档,请大家谅解!以后我会陆续整理公布该组件的所有相关文档及源码!

< AN lang=EN-US>< AN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-ha i-font-family: 'Times New Roman'">设置字段变量

procedure TMyFieldInfo.SetVariables(d: TDataset);

var

< AN style="mso- acerun: yes">  value : String;

begin

//设置变量值

< AN style="mso- acerun: yes">  if A iU erCase(FilterValue) = 'NULL' then

< AN style="mso- acerun: yes">  exit;

< AN style="mso- acerun: yes">  if FieldType = ftString then

< AN style="mso- acerun: yes">  begin

< AN style="mso- acerun: yes">  if CaseSe itive then

< AN style="mso- acerun: yes">  case MatchType of

< AN style="mso- acerun: yes">   fdMatchStart, fdMatchAny :

< AN style="mso- acerun: yes">  value := FilterValue;

< AN style="mso- acerun: yes">  fdMatchEnd :

< AN style="mso- acerun: yes">  value := '%' + FilterValue;

< AN style="mso- acerun: yes">  fdMatchExact :

< AN style="mso- acerun: yes">  value := FilterValue;

< AN style="mso- acerun: yes">  end

< AN style="mso- acerun: yes">  else

< AN style="mso- acerun: yes">  case MatchType of

< AN style="mso- acerun: yes">  fdMatchStart, fdMatchAny :

< AN style="mso- acerun: yes">   value := A iU erCase(FilterValue);

< AN style="mso- acerun: yes">  fdMatchEnd :

< AN style="mso- acerun: yes">  value := '%' + A iU erCase(FilterValue);

< AN style="mso- acerun: yes">  fdMatchExact :

< AN style="mso- acerun: yes">  value := A iU erCase(FilterValue);

< AN style="mso- acerun: yes">  end;

< AN style="mso- acerun: yes">  end

< AN style="mso- acerun: yes">  else

< AN style="mso- acerun: yes">  value := FilterValue;

< AN style="mso- acerun: yes">  if d is TDataSet then

< AN style="mso- acerun: yes">  begin

< AN style="mso- acerun: yes">  if MatchType < gt; fdMatchRange then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'Filter').Value :=  value

< AN style="mso- acerun: yes">  else

< AN style="mso- acerun: yes">  begin

< AN style="mso- acerun: yes">  if CaseSe itive then

< AN style="mso- acerun: yes">  begin

< AN style="mso- acerun: yes">  if StartingValue < gt; '' then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'Start').Value := StartingValue;

< AN style="mso- acerun: yes">  if EndingValue < gt; '' then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'End').Value := EndingValue;

< AN style="mso- acerun: yes">  end

< AN style="mso- acerun: yes">  else

< AN style="mso- acerun: yes">  begin

< AN style="mso- acerun: yes">  if StartingValue < gt; '' then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'Start').Value := A iU erCase(StartingValue);

< AN style="mso- acerun: yes">  if EndingValue < gt; '' then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'End').Value := A iU erCase(EndingValue);

< AN style="mso- acerun: yes">  end;

< AN style="mso- acerun: yes">  end;

< AN style="mso- acerun: yes">  end

< AN style="mso- acerun: yes">  else

< AN style="mso- acerun: yes">  begin

< AN style="mso- acerun: yes">  if MatchType < gt; fdMatchRange then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'Filter').Value :=  value

< AN style="mso- acerun: yes">  else

< AN style="mso- acerun: yes">  begin

< AN style="mso- acerun: yes">  if CaseSe itive then

< AN style="mso- acerun: yes">  begin

< AN style="mso- acerun: yes">  if StartingValue < gt; '' then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'Start').Value := StartingValue;

< AN style="mso- acerun: yes">  if EndingValue < gt; '' then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'End').Value := EndingValue;

< AN style="mso- acerun: yes">  end

< AN style="mso- acerun: yes">  else

< AN style="mso- acerun: yes">  begin

< AN style="mso- acerun: yes">  if StartingValue < gt; '' then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'Start').Value := A iU erCase(StartingValue);

< AN style="mso- acerun: yes">  if EndingValue < gt; '' then

< AN style="mso- acerun: yes">  TQuery(d).ParamByName(FieldName + 'End').Value := A iU erCase(EndingValue) 

< AN style="mso- acerun: yes">  end;

< AN style="mso- acerun: yes">  end;

< AN style="mso- acerun: yes">  end

end;

 

< AN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-ha i-font-family: 'Times New Roman'">定义参数变量类

TDBVariable = cla < AN style="mso- acerun: yes">  //参数数据变量

< AN style="mso- acerun: yes">  public

< AN style="mso- acerun: yes">  VariableName : String  //变量名< AN style="mso- acerun: yes"> 

< AN style="mso- acerun: yes">  VariableValue : Variant  //变量值

< AN style="mso- acerun: yes">  co tructor Create(name : String; value : Variant); //构造函数

< AN style="mso- acerun: yes">  end;

 



 

娱乐图摘

更多 >>

靓丽清纯美女meimei

美女私房全裸照
导演劝女演员脱衣服(视频)

大胆火辣人体艺术写真(图)

黑丝妹妹热辣诱惑-丝袜美女妹妹

PLMM 漂亮妹妹图集-妹妹图库

全球美女图库-美女集中营

52MM 我爱漂亮妹妹-制服妹妹诱惑

图王图库-世界美女明星图片资料库
美女写真集锦

激情两性-解密性生活
浴室MM湿身内衣诱惑
邻家小妹洗澡被偷拍(视频)

热点文章

更多

· 使用MIDAS访问远程Access数据库_Delphi教程_
· Delphi2005学习笔记4——再谈NameSpace和D
· 多层数据库开发十二:使用数据控件_Delphi教程_src1
· 在Delphi中自己建立交叉表_Delphi教程_src11
· 用Delphi设计代理服务器_Delphi教程_src119
· Delphi开发单机瘦数据库程序要点_Delphi教程_sr
· 拖拉打开文件_Delphi教程_src119.com
· 搜索字符串在流中的位置_Delphi教程_src119.co
· 用Delphi编写Win2000服务程序_Delphi教程_
· 創建一個簡單的"專家"_Delphi教程

热点文章

更多