combox.item.add('....'),这是加一条,对于多个记录怎么控制?

解决方案 »

  1.   

    补充一下,不想用lookupcombox!
      

  2.   

    while not query.eof do
    begin
      combox.item.add(Query.fieldByName('field').asstring);
      Query.next; 
    end
      

  3.   

    向一个combobox中添加itemcombobox1.Items.clear;
     with qry do
     begin
       close;
       sql.Clear;
       sql.add('select * from table1 order by zd1');
       open;
       first;
     end;
     if qry.RecordCount>0 then
       combobox1.text:=qry.fields[2].asstring;
     repeat
       combobox1.Items.Add(qry.fields[2].asstring);
     until qry.findnext=false;
      

  4.   

    combobox1.Items.clear;
     with ADOQuery1 do
     begin
        Close;
        Clear;
        SQL.Add('select * from Table');
        Open;
      end;
      if AdoQuery1.RecordCount > 0 then
    begin
    ADOQuery1.First;
    while not ADOQuery1.Eof do
    begin
        ComboBox1.Items.ADD(ADOQuery1.FieldByName(FieldName).AsString);
        ADOQuery1.Next;
    end;
    end;