if ComboBox1.Text='全部' then
begin
SQL.Add('select * from rszx where xl like:xl1 and mm like:mm1 and xm like:xm1 and zy like:zy1 and sf like:sf1 and yx like:yx1');
Parameters.ParamValues['xl1']:='%'+xledit.text+'%';
Parameters.ParamValues['xm1']:='%'+xmedit.text+'%';
Parameters.ParamValues['mm1']:='%'+mmedit.text+'%';
Parameters.ParamValues['zy1']:='%'+zyedit.text+'%';
Parameters.ParamValues['sf1']:='%'+sfedit.text+'%';
Parameters.ParamValues['yx1']:='%'+yxedit.text+'%';
end
else
begin
SQL.Add('select * from rszx where dw like:dw1 and xl like:xl1 and mm like:mm1 and xm like:xm1 and zy like:zy1 and sf like:sf1 and yx like:yx1');
Parameters.ParamValues['dw1']:='%'+combobox1.text+'%';
Parameters.ParamValues['xl1']:='%'+xledit.text+'%';
Parameters.ParamValues['xm1']:='%'+xmedit.text+'%';
Parameters.ParamValues['mm1']:='%'+mmedit.text+'%';
Parameters.ParamValues['zy1']:='%'+zyedit.text+'%';
Parameters.ParamValues['sf1']:='%'+sfedit.text+'%';
Parameters.ParamValues['yx1']:='%'+yxedit.text+'%';
end;
这个是代码,就是在用COMBOBOX1进行选择进行查询时,不能全部列出与COMBOBOX1相符合的数据,请高手解决,同时希望各位高手能提供简单的多条件查询的代码.
begin
SQL.Add('select * from rszx where xl like:xl1 and mm like:mm1 and xm like:xm1 and zy like:zy1 and sf like:sf1 and yx like:yx1');
Parameters.ParamValues['xl1']:='%'+xledit.text+'%';
Parameters.ParamValues['xm1']:='%'+xmedit.text+'%';
Parameters.ParamValues['mm1']:='%'+mmedit.text+'%';
Parameters.ParamValues['zy1']:='%'+zyedit.text+'%';
Parameters.ParamValues['sf1']:='%'+sfedit.text+'%';
Parameters.ParamValues['yx1']:='%'+yxedit.text+'%';
end
else
begin
SQL.Add('select * from rszx where dw like:dw1 and xl like:xl1 and mm like:mm1 and xm like:xm1 and zy like:zy1 and sf like:sf1 and yx like:yx1');
Parameters.ParamValues['dw1']:='%'+combobox1.text+'%';
Parameters.ParamValues['xl1']:='%'+xledit.text+'%';
Parameters.ParamValues['xm1']:='%'+xmedit.text+'%';
Parameters.ParamValues['mm1']:='%'+mmedit.text+'%';
Parameters.ParamValues['zy1']:='%'+zyedit.text+'%';
Parameters.ParamValues['sf1']:='%'+sfedit.text+'%';
Parameters.ParamValues['yx1']:='%'+yxedit.text+'%';
end;
这个是代码,就是在用COMBOBOX1进行选择进行查询时,不能全部列出与COMBOBOX1相符合的数据,请高手解决,同时希望各位高手能提供简单的多条件查询的代码.
Parameters.ParamValues['xl1']:=''%'+xledit.text+'%''';