我写了这段程序,将某字段读入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;
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;
解决方案 »
- WM运行一段时间之后 图片不能加载
- 有关WORD模板调用的问题(很急,若解决,分不是问题)
- 调用DLL中的MDI主窗口的问题
- Delphi5中使用ServerSocket传送数据,为什么内存会不断的增加?请问如何解决?
- 大家 来看看吧
- 请问Form运行时各事件的执行顺序是怎样的啊?
- 请教高手!!!!(在线等待)
- 急,求救,今天晚上就要...............
- 不知“战友”发现没有,安装D5之后,再安装众多的第三方控件,如果系统出现问题(要重新格格式化),则重新装D5和众多的第三方控件,能不能把整个的D5(当然包括已正确安装 众多的第三方控件)系统做成一个ZIP文件,怎么做???,请指导!!
- 神啊!救救我吧!
- 请教高手,继承父类的空DBGrid,在子类中增加了静态列,不能删除,请问真的不能删除吗?
- delphi连接数据库的相对路径问题?
ComboBoxTable(ComboBox1, ADOills, 1);
[Error] newcust.pas(89): Incompatible types: 'TCustomComboBox' and 'TComboBox'
定义改成:
procedure ComboBoxTable(cb: TComboBox ; tb: TDataSet ; nfield: Integer);