請問怎麼樣把select 出來的好幾個結果放到combobox的下拉列表中去

解决方案 »

  1.   

    Combobox的Items属性,是TStrings类型的,你可以使用它的ADD方法,添加。Combobox.Items.Clear;
    Combobox.Items.Add(你的查询结果当前某字符串型字段);结合DataSet.Next等方法,循环。
      

  2.   

    with AdoQuery1 do
    begin
             Close;
             SQL.Text:='SELECT DISTINCT 字段 FROM Tabel';
             Open;
             while not EOF do
             begin
                ComboBox1.Items.Add(Fields[0].AsString);
                Next;
             end;
    end;
      

  3.   

    UP 樓上的...就是這樣...HsWong的速度還真快啊.
      

  4.   

    HsWong() 的没错。
    也可以完善一下,加 ComboBox1.Items.Clear;
      

  5.   

    我也优化一下
    SQL.Text:='SELECT DISTINCT 字段 FROM Tabel where 字段 is not null';