A
antihermit
Unregistered / Unconfirmed
GUEST, unregistred user!
我想要在实现多值模糊查询要如何实现阿?
我只知道在delphi重视这样实现的:
if xb_edit.Text <> '所有' then
gycx := gycx + ' and EmployeesSex =' + QuotedStr(xb_edit.Text);
if gybh_edit.Text <> '' then
gycx := gycx + ' and '+' EmployeesNo like '+QuotedStr('%'+ gybh_edit.Text +'%');
if qq_edit.Text <> '' then
gycx:= gycx+' and '+'EmployeesQQ like '+QuotedStr('%' + qq_edit.Text+ '%');
if name_edit.Text <> '' then
gycx:=gycx+' and '+'EmployeesName like'+quotedstr('%'+name_edit.Text+'%');
if telephone_edit.Text <> '' then
gycx:=gycx+' and '+'EmployeesTelephoneNo like'+quotedstr('%'+telephone_edit.Text+'%');
ADO_gycx.Close;
ADO_gycx.SQL.Clear ;
ADO_gycx.SQL.Text := 'select EmployeesNo,EmployeesSex,EmployeesName,EmployeesCodeDate '
+', EmployeesAddress, EmployeesTelephoneNo, EmployeesEmail, EmployeesQQ from EmployeesCode where 1=1 '+
' and EmployeesCodeDate >= ' + QuotedStr(DateToStr(datefrom_edit.date)) + ' and EmployeesCodeDate <='+QuotedStr(DateToStr(dateend_edit.date)) + gycx;
ADO_gycx.Open;
c++ builder 应该不一样吧,要如何实现呢?
我只知道在delphi重视这样实现的:
if xb_edit.Text <> '所有' then
gycx := gycx + ' and EmployeesSex =' + QuotedStr(xb_edit.Text);
if gybh_edit.Text <> '' then
gycx := gycx + ' and '+' EmployeesNo like '+QuotedStr('%'+ gybh_edit.Text +'%');
if qq_edit.Text <> '' then
gycx:= gycx+' and '+'EmployeesQQ like '+QuotedStr('%' + qq_edit.Text+ '%');
if name_edit.Text <> '' then
gycx:=gycx+' and '+'EmployeesName like'+quotedstr('%'+name_edit.Text+'%');
if telephone_edit.Text <> '' then
gycx:=gycx+' and '+'EmployeesTelephoneNo like'+quotedstr('%'+telephone_edit.Text+'%');
ADO_gycx.Close;
ADO_gycx.SQL.Clear ;
ADO_gycx.SQL.Text := 'select EmployeesNo,EmployeesSex,EmployeesName,EmployeesCodeDate '
+', EmployeesAddress, EmployeesTelephoneNo, EmployeesEmail, EmployeesQQ from EmployeesCode where 1=1 '+
' and EmployeesCodeDate >= ' + QuotedStr(DateToStr(datefrom_edit.date)) + ' and EmployeesCodeDate <='+QuotedStr(DateToStr(dateend_edit.date)) + gycx;
ADO_gycx.Open;
c++ builder 应该不一样吧,要如何实现呢?