如何将数据表adotable的一个字段的内容放到combobox的items中,供选择用?
急用!请大侠帮忙

解决方案 »

  1.   

    哈哈:
    Combobox1.Items.Add(Table1.FieldByName('字段名').AsString);
      

  2.   

    for i=0 to adotable.recordcount do
    begin
    combobox.items(i):=table.fieldbyname("字段").asstring
    end
      

  3.   

    adotable.first;
    for i=0 to adotable.recordcount do
    begin
    combobox.items.add( table.fieldbyname("字段").asstring);
    adotable.next;
    end
      

  4.   

    用ADOQUERY吧
    with adoquery1 do
    try
      close;
      sql.clear;
      sql.add('select Field1 from yourtable where......');
      prepared;
      open;
      if not isempty then
        begin
          first;
          while not eof do
            begin
              combobox.items.add(Fields[0].asstring);
              next;
            end;
       end;
    except
       messagebox(self.handle,'error','information',mb_ok);
       exit;
    end;