用循环吧...adoquery1.first; combobox1.items.clear; while adoquery1.eof do begin form1.combobox1.items.add(adoquery1.fieldbyname('字段').value); adoquery1.next; end;//随手写的...意思是这样...
while adoquery1.eof do begin //漏了not 加上...^_^while not adoquery1.eof do begin
qry.close; qry.sql.clear; qry.sql.add('select distinct xx from t '); qry.open;cmb.item.clear; qry.first; while (not qry.eof ) do begin cmb.text:=qry.fields[0].asstring; qry.next; end; K0!!!!
其实就是循环取得记录在combobox的item里面添加上去就行了
同意 gxgyj(杰克.逊) 的。
query.close; query.sql.clear; query.sql.text='select distinct field from table'; query.open;cmbox.item.clear; query.first; while not query.eof do begin cmbox.text:=query.fields[0].asstring; query.next; end;you can try!也同意gxgyj(杰克.逊)的。
combobox1.items.clear;
while adoquery1.eof do begin
form1.combobox1.items.add(adoquery1.fieldbyname('字段').value);
adoquery1.next;
end;//随手写的...意思是这样...
//漏了not 加上...^_^while not adoquery1.eof do begin
qry.sql.clear;
qry.sql.add('select distinct xx from t ');
qry.open;cmb.item.clear;
qry.first;
while (not qry.eof ) do
begin
cmb.text:=qry.fields[0].asstring;
qry.next;
end;
K0!!!!
query.sql.clear;
query.sql.text='select distinct field from table';
query.open;cmbox.item.clear;
query.first;
while not query.eof do
begin
cmbox.text:=query.fields[0].asstring;
query.next;
end;you can try!也同意gxgyj(杰克.逊)的。