在combobox ondropdown 事件里添加如下代码 前提是你已经是用adoquery连接到所需要的数据库 with adoquery do begin close; sql.clear; sql.text:='select field from table'; sql.open; first; while not eof then begin combobox.items.add(fieldbyname('field').asstring); next; end;end;
with adoquery do begin close; sql.text:='select field from table'; open; first; while not eof then begin combobox.items.add(fieldbyname('field').asstring); next; end;end; 纠正
前提是你已经是用adoquery连接到所需要的数据库
with adoquery do
begin
close;
sql.clear;
sql.text:='select field from table';
sql.open;
first;
while not eof then
begin
combobox.items.add(fieldbyname('field').asstring);
next;
end;end;
begin
close;
sql.text:='select field from table';
open;
first;
while not eof then
begin
combobox.items.add(fieldbyname('field').asstring);
next;
end;end;
纠正