填充CombBox Delphi FireDac中的问题

时间:2018-06-26 21:21:43

标签: delphi firedac

我正在尝试通过以下例程填充ComboBox:


    procedure Tfrm_Estoque.FormCreate(Sender: TObject);
begin
 Query1.Close;
 Query1.SQL.Clear;
 Query1.Open('select produto from Dados_Estoque');
 Combobox1.Text:='';
  while not Query1.Eof do begin
    Combobox1.Items.Add(Query1.FieldByName('produto').AsString);
    Query1.Next;
  end;
 if Combobox1.Items.Count>0 then
    Combobox1.ItemIndex:= 0; //seleciona o primeiro
 Query1.Close;
end;

它告诉我在编译之前没有找到第一个字段。我不想处理,但要处理另一个名为“ Produto”(varchar)的字段。我的查询属性中是否有任何可能的设置?

0 个答案:

没有答案