function调用及定义如下:
sql:='Select kt_ID,kt_name From tblSubject';
  captionFieldName:='kt_name';
  valueFieldName:='kt_ID';
  noAsFirst:=True;
  if not FillInComBoBoxWithAdoQuery(Query1;ComboBox1;sql;captionFieldName;valueFieldName;noAsFirst) then
   begin
      ShowMessage('数据库连接错误');
   end;
function函数:
function FillInComBoBoxWithAdoQuery(objAdoQuery:TAdoQuery;objComBoBox:TComboBox;sql:string;captionFieldName:string;valueFieldName:string;noAsFirst:boolean):boolean;