如题,怎样把一个表的某个字段的内容加到TComboBox的item中?

解决方案 »

  1.   

    combobox1.items.clear;
    with adoquery1 do
    begin
      open;
      first;
      while not eof do
      begin
        combobox1.items.add(fieldbyname('field').asstring);
        next;
      end;
    end;
      

  2.   

    while not table1.eof do
    begin
    comobobox1.items.add(table1.fieldbyname('fieldname').asstring);
    table1.next;
    end
      

  3.   

    combobox1.items.clear;
    with adoquery1 do
    begin
      open;
      first;
      while not eof do
      begin
        combobox1.items.add(fieldbyname('field').asstring);
        next;
      end;
    end;