本人使用dbcombobox与sql2000数据表中的某个字段连接,我使用的方法是:
procedure TForm7.DBComboBox1DropDown(Sender: TObject);
var
I: Integer;
begin
inherited;
//DBComboBox1.Clear;
with DataModule1.ADOQuery2 do
begin
SQL.clear;
SQl.Text := 'select 客户全称 from 客户基础信息表 ';
Close;
Active := False;
prepared := False;
prepared := True;
Active := True;
if (recordcount > 0) then
first;
for i := 0 to recordcount - 1 do
begin //取得该列所有的数据到combobox1控件中
DBComboBox1.Items.add(FieldByName('客户全称').asstring);
next;
end;
end;
end;
现在的问题是在dbcombobox中已将字段条目的所有内容添加了,但是不能进行条目的选取和显示,比如我要换一个条目在dbcombobox中没有显示,也不改变.为什么?
procedure TForm7.DBComboBox1DropDown(Sender: TObject);
var
I: Integer;
begin
inherited;
//DBComboBox1.Clear;
with DataModule1.ADOQuery2 do
begin
SQL.clear;
SQl.Text := 'select 客户全称 from 客户基础信息表 ';
Close;
Active := False;
prepared := False;
prepared := True;
Active := True;
if (recordcount > 0) then
first;
for i := 0 to recordcount - 1 do
begin //取得该列所有的数据到combobox1控件中
DBComboBox1.Items.add(FieldByName('客户全称').asstring);
next;
end;
end;
end;
现在的问题是在dbcombobox中已将字段条目的所有内容添加了,但是不能进行条目的选取和显示,比如我要换一个条目在dbcombobox中没有显示,也不改变.为什么?
解决方案 »
- tidtelnet输入过快导致程序无法执行
- 怎么进入特殊的目录????????急,十分棘手啊!
- 类似VB中的MSVBVM60.DLL问题????
- 如何制作DELPHI安装文件!
- 在线,StringGrid 里的内容如何进行打印?
- Delphi的经典教材???
- BDE连接选项 enable BCD 是什么意思?
- 关于MDI窗体的菜单操作的几个问题,请各位来看看!
- 什么P2P、如何开发P2P程序?
- 奇怪的流与动态数组问题
- 软件开发项目,从立项、定义、需求分析、概要设计、详细设计、编码实现、测试等,大家认为各开发阶段应该优先选用哪些配套的易用、优秀的开发工具。并且通过对优秀的开发工具的合理评价和交流,方便我们广大开发者。
- 急求SQL语句:要求把某表21列-25列相加之和放在20行!D7+acess环境!困扰N年了!
while not eof do
begin
....;
next;
end;
是否设置了DataSourect和DataField属性
其实用TCombobox挺好的,干嘛非用感知控件。