我写了这段程序,将某字段读入comboBox,用D7编译,调用时说类型不兼容!可是我以前在D6用它好好的。
procedure ComboBoxTable(cb: TCustomComboBox ; tb: TDataSet ; nfield: Integer);
begin
   cb.Clear();
   if (not tb.Active) then
      tb.Open();
   tb.First();
   while(not tb.Eof) do
      begin
      cb.Items.Add(tb.Fields.Fields[nfield].AsString);
      tb.Next();
      end;//   tb.Close();
end;