用ADOQuery查询返回的记录集,是被查询的表中的其中一个字段的,如何把这些记录传给combobox的下拉列表里?急!!!

解决方案 »

  1.   

    用循环吧...adoquery1.first;
    combobox1.items.clear;
    while adoquery1.eof do begin
      form1.combobox1.items.add(adoquery1.fieldbyname('字段').value);
      adoquery1.next;
    end;//随手写的...意思是这样...
      

  2.   

    while adoquery1.eof do begin
    //漏了not 加上...^_^while not adoquery1.eof do begin
      

  3.   

    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!!!!
      

  4.   

    其实就是循环取得记录在combobox的item里面添加上去就行了
      

  5.   

    同意  gxgyj(杰克.逊)  的。
      

  6.   

    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(杰克.逊)的。