小
小女人
Unregistered / Unconfirmed
GUEST, unregistred user!
ADOQuery2.SQL.add('select * from hnit where jyfw like ''%'+hdss+'%'' and ds like ''%'+hdsy+'%'' order by '+sign+' desc');
我想可能是SQL写法上有错!帮我看看吧!
-------------------------------------------------------------
procedure TForm2.Button2Click(Sender: TObject);
var
hdss:string;
hdsy:string;
sign:string;
begin
if radiogroup1.ItemIndex=-1 then
hdss:=''
else
hdss:=RadioGroup1.items[RadioGroup1.ItemIndex];
if combobox2.Text='全省' then
hdsy:=''
else
hdsy:=ComboBox2.text;
case RadioGroup1.ItemIndex of
0: sign:='1';
1: sign:='2';
2: sign:='3';
3: sign:='4';
4: sign:='5';
5: sign:='6';
6: sign:='7';
7: sign:='8';
8: sign:='9';
9: sign:='bgjj';
10: sign:='10';
11: sign:='11';
12: sign:='12';
13: sign:='13';
14: sign:='14';
15: sign:='15';
else sign:='nu';
end;
with ADOQuery2 do
begin
ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.add('select * from hnit where jyfw like ''%'+hdss+'%'' and ds like ''%'+hdsy+'%'' order by '+sign+' desc');
ADOQuery2.Open;
if ADOQuery2.Eof=false then
StatusBar1.SimpleText:=' 当前搜索条件为:'+hdsy+'经营'+hdss+'的所有商家'
else
MessageDlg('没有您要查找的公司',mtwarning,[mbok],0);
end;
end;
我想可能是SQL写法上有错!帮我看看吧!
-------------------------------------------------------------
procedure TForm2.Button2Click(Sender: TObject);
var
hdss:string;
hdsy:string;
sign:string;
begin
if radiogroup1.ItemIndex=-1 then
hdss:=''
else
hdss:=RadioGroup1.items[RadioGroup1.ItemIndex];
if combobox2.Text='全省' then
hdsy:=''
else
hdsy:=ComboBox2.text;
case RadioGroup1.ItemIndex of
0: sign:='1';
1: sign:='2';
2: sign:='3';
3: sign:='4';
4: sign:='5';
5: sign:='6';
6: sign:='7';
7: sign:='8';
8: sign:='9';
9: sign:='bgjj';
10: sign:='10';
11: sign:='11';
12: sign:='12';
13: sign:='13';
14: sign:='14';
15: sign:='15';
else sign:='nu';
end;
with ADOQuery2 do
begin
ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.add('select * from hnit where jyfw like ''%'+hdss+'%'' and ds like ''%'+hdsy+'%'' order by '+sign+' desc');
ADOQuery2.Open;
if ADOQuery2.Eof=false then
StatusBar1.SimpleText:=' 当前搜索条件为:'+hdsy+'经营'+hdss+'的所有商家'
else
MessageDlg('没有您要查找的公司',mtwarning,[mbok],0);
end;
end;