procedure TForm3.Button3Click(Sender: TObject);
var i,j:integer;
var str1,str2,str3:string;
begin
with adoquery1 do
begin
close;
sql.Clear;
if combobox5.Text='' then
str1:=''
else
str1:=' and new_blade_type='''+combobox5.Text+'''';
if combobox7.Text='' then
str2:=''
else
str2:=' and team='''+combobox7.Text+'''';
if Edit9.Text='' then
str3:=''
else
str3:=' and operator='''+Edit9.Text+'''';
Sql.Text:='select * from blade where 1=1'+str1+str2+str3;
open;
First;
stringgrid1.RowCount:=RecordCount;
stringgrid1.ColCount:=Fields.Count;
for i:=1 to stringgrid1.RowCount-1 do
begin
for j:=1 to stringgrid1.ColCount-1 do
stringgrid1.Cells[j,i]:=Fields[j].Value;
Next;
end;
end;
ADOQUERY1.close;
end;
//This code work without any errors but show nothing when click the button3.
BTW
I am really a ROOKIE ,If I violate anything ,just give me a feedback. thanks a lot.