delphi 万能模糊查询


本文整理自网络,侵删。

 delphi 万能模糊查询
var
S_sql:string;
begin
S_sql:='';
if KH_BH.Text<>'' then
begin
S_sql:=S_sql+' and BH like''%'+KH_BH.Text+'%''';
end;
if KH_GYS.Text<>'' then
begin
S_sql:=S_sql+' and GYS like''%'+KH_GYS.Text+'%''';
end;
if KH_DH.Text<>'' then
begin
S_sql:=S_sql+' and DH like''%'+KH_DH.Text+'%''';
end;
if KH_CZ.Text<>'' then
begin
S_sql:=S_sql+' and CZ like''%'+KH_CZ.Text+'%''';
end;
if KH_LXR1.Text<>'' then
begin
S_sql:=S_sql+' and LXR like''%'+KH_LXR1.Text+'%''';
end;
if KH_DH1.Text<>'' then
begin
S_sql:=S_sql+' and DH1 like''%'+KH_DH1.Text+'%''';
end;
if KH_DH2.Text<>'' then
begin
S_sql:=S_sql+' and DH2 like''%'+KH_DH2.Text+'%''';
end;
if KH_LXR2.Text<>'' then
begin
S_sqL:=S_sql+' and LXR2 like''%'+KH_LXR2.Text+'%''';
end;
if KH_DZ.Text<>'' then
begin
S_sql:=S_sql+' and DZ like''%'+KH_DZ.Text+'%''';
end;
with dm1.customer1 do
begin
close;
sql.Clear;
sql.Add('select * from customer where 1=1 '+S_sql+'order by id desc');
open;
end;
end;

相关阅读 >>

Delphi xe 的 tdictionary

Delphi 遍历pe文件

强大的Delphi rtti--兼谈需要了解多种开发语言

Delphi 获取其他进程句柄的几种方法

Delphi xe filesizebyname 要引用哪些文件

Delphi 得到字符串拼音首字母

Delphi xe 使用asqlite操作sqlite数据库乱码

idhttp获取文件大小的代码

Delphi异常处理try except语句和try finally语句用法以及区别

Delphi dcc32.exe 参数说明

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...