定义combobox的过程错误
本帖最后由 huaipiqi_net 于 2012-12-23 12:16:04 编辑 我在测试delphi操作Mysql的时候
我想写一个刷新数据库到combobox中的过程
代码我是这么写的 我是想的是 写一个过程 以后想在哪一个combobox中刷新数据就把combobox当做变量传入
procedure TDataModule1.sxcombox(biaom,zhim:string; com:TComboBox);
var //统一刷新数据的过程
i:integer;
begin
with DataModule1.adoquery2 do
begin
close;
sql.text:='select * from '+trim(biaom);
open;
com.items.clear;
while not eof do
begin
com.items.add(fieldByname(zhim).asstring);
next;
end;
end;
end;