TO 楼上:combobox中最多有多少个item? 呵呵,我怎么觉得好象我从数据库里查询加入的数量不仅仅那么少? ------------ 上面是楼主的描述。应该就是要一个Integer吧,不会是要浮点。
procedure TFrmWzrk.ComboBox1DropDown(Sender: TObject); var GetDropDownQuery: Tadoquery; querystr: string; begin combobox1.Items.Clear; querystr := combobox1.Text; GetDropDownQuery := Bussiness.ReturnDQuery('select gh_mc,gh_id from gh_table ' + ' where gh_mc like ''%' + querystr + '%'' or gh_py like ''%' + querystr + '%''', self); with getdropdownquery do begin while not eof do begin combobox1.Items.Add(fieldbyname('gh_mc').AsString);//增加!~ combobox1.Values.Add(fieldbyname('gh_id').AsString); next;//继续查符合标准 end; end; end; 那是相当的多了!~应该可以满足你的需要!~
#define MaxInt (int)(2147483647)MaxListSize = Maxint div 16;
procedure TFrmWzrk.ComboBox1DropDown(Sender: TObject); var GetDropDownQuery: Tadoquery; querystr: string; begin combobox1.Items.Clear; querystr := combobox1.Text; GetDropDownQuery := Bussiness.ReturnDQuery('select gh_mc,gh_id from gh_table ' + ' where gh_mc like ''%' + querystr + '%'' or gh_py like ''%' + querystr + '%''', self); with getdropdownquery do begin while not eof do begin combobox1.Items.Add(fieldbyname('gh_mc').AsString);//增加!~ combobox1.Values.Add(fieldbyname('gh_id').AsString); end; end; end;
呵呵,我怎么觉得好象我从数据库里查询加入的数量不仅仅那么少?
------------
上面是楼主的描述。应该就是要一个Integer吧,不会是要浮点。
var GetDropDownQuery: Tadoquery;
querystr: string;
begin
combobox1.Items.Clear;
querystr := combobox1.Text;
GetDropDownQuery := Bussiness.ReturnDQuery('select gh_mc,gh_id from gh_table '
+ ' where gh_mc like ''%' + querystr + '%'' or gh_py like ''%' + querystr + '%''', self);
with getdropdownquery do
begin
while not eof do
begin
combobox1.Items.Add(fieldbyname('gh_mc').AsString);//增加!~
combobox1.Values.Add(fieldbyname('gh_id').AsString);
next;//继续查符合标准
end;
end;
end;
那是相当的多了!~应该可以满足你的需要!~
var GetDropDownQuery: Tadoquery;
querystr: string;
begin
combobox1.Items.Clear;
querystr := combobox1.Text;
GetDropDownQuery := Bussiness.ReturnDQuery('select gh_mc,gh_id from gh_table '
+ ' where gh_mc like ''%' + querystr + '%'' or gh_py like ''%' + querystr + '%''', self);
with getdropdownquery do
begin
while not eof do
begin
combobox1.Items.Add(fieldbyname('gh_mc').AsString);//增加!~
combobox1.Values.Add(fieldbyname('gh_id').AsString);
end;
end;
end;
正解