路产管理系统 第21页

 

if trim(edtWidthE.Text) <> '' then

  begin

   strWhere := ifthen(strwhere = '', '', strWhere + ' and ') + ' Cint(桥面总宽)<='+uppercase(trim(edtWidthE.Text));

  end;

 

  if trim(edtLenB.Text) <> '' then

  begin

   strWhere := ifthen(strwhere = '', '', strWhere + ' and ') + ' Cint(桥长)>='+uppercase(trim(edtLenB.Text));

  end;

 

  if trim(edtLenE.Text) <> '' then

  begin

   strWhere := ifthen(strwhere = '', '', strWhere + ' and ') + ' Cint(桥长)<='+uppercase(trim(edtLenE.Text));

  end;

 

  if  strWhere='' then

  begin

    strWhere := '编号 = ''0''';

  end;

 

  strWhere := ifthen(strwhere = '', '', ' where ' + strWhere);

 

  self.QryMaster.Close;

  self.QryMaster.SQL.Clear;

  self.QryMaster.SQL.Add('select * from桥梁 ' + strWhere+' order by ±编号 ');

  try

    self.QryMaster.Open;

    DM.SqlString:='select * from 桥梁 ' + strWhere+' order by ±编号 ';

  except

  end;

end;

这段是卡片维护中重要的功能,它实现了多条件查询,首先这段代码的开始定义了一个变量并且付给它了空。后面用了if then语句来完成条件查询。

多条件查询功能实现流程图以其中两个条件为例:

 << 上一页  [21] [22] [23] [24] [25] [26] [27] [28] [29] 下一页

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有