While not Table.Eof do begin ComboBox.Items.add('字段内容'); Table.Next; end;
query1.Close; query1.SQL.Clear; query1.SQL.add('select 消费名称 from tablename'); query1.Open; while not query1.Eof do begin combobox1.Items.Add(query1.fieldbyname('消费名称').AsString); query1.Next; end;
begin
ComboBox.Items.add('字段内容');
Table.Next;
end;
query1.SQL.Clear;
query1.SQL.add('select 消费名称 from tablename');
query1.Open;
while not query1.Eof do
begin
combobox1.Items.Add(query1.fieldbyname('消费名称').AsString);
query1.Next;
end;
与数据库关联起来,用不着代码!