with ADOQuery1do begin close; commandtext:='select xlmc from cam_cp_name'; open; first; while not eof do begin for i:=1 to recordcount do begin dbcombobox1.items.add(trim(fieldbyname('xlmc').asstring)); next; end; end; end;
不好意思,改正如下: with ADOQuery1 do begin close; commandtext:='select 字段名 from table'; open; first; while not eof do begin dbcombobox1.items.add(trim(fieldbyname('字段名').asstring)); next; end;
begin
close;
commandtext:='select xlmc from cam_cp_name';
open;
first;
while not eof do
begin
for i:=1 to recordcount do
begin
dbcombobox1.items.add(trim(fieldbyname('xlmc').asstring));
next;
end;
end;
end;
with ADOQuery1 do
begin
close;
commandtext:='select 字段名 from table';
open;
first;
while not eof do
begin
dbcombobox1.items.add(trim(fieldbyname('字段名').asstring));
next;
end;
end;