//动态添加表的字段名: var i:integer; begin Table1.open; ComboBox1.Items.Clear; with Table1 do begin for i:=0 to FieldCount-1 do ComboBox1.Items.Add(Fields[i].FieldName) end; table1.close; end; //动态添加表中某字段的值: begin with Table1 do begin open; first; while not eof do begin ComboBox1.Items.Add(fieldbyname('aaa').AsString); next; end; end; end;以上Table可以改成query
var i:integer;
begin
Table1.open;
ComboBox1.Items.Clear;
with Table1 do
begin
for i:=0 to FieldCount-1 do
ComboBox1.Items.Add(Fields[i].FieldName)
end;
table1.close;
end;
//动态添加表中某字段的值:
begin
with Table1 do
begin
open;
first;
while not eof do
begin
ComboBox1.Items.Add(fieldbyname('aaa').AsString);
next;
end;
end;
end;以上Table可以改成query
就是这样的,可以结贴了!