为什么我这样写不能将字段的值添加到ITEM,应该怎么实现?procedure TBSXXFMN.ComboBox1Click(Sender: TObject);
var
i:integer;
begin
with bsdm.QBSKD do
begin
close;
sql.Clear;
sql.Text:='select BSCNAM from BSKD';
Open;
if (RecordCount > 0) then
First ;
for i := 0 to RecordCount - 1 do
begin
combobox1.Items.Add(fieldbyname('BSCNAM').AsString);
next ;
end;
end;
end;
var
i:integer;
begin
with bsdm.QBSKD do
begin
close;
sql.Clear;
sql.Text:='select BSCNAM from BSKD';
Open;
if (RecordCount > 0) then
First ;
for i := 0 to RecordCount - 1 do
begin
combobox1.Items.Add(fieldbyname('BSCNAM').AsString);
next ;
end;
end;
end;
解决方案 »
- 第一次发帖,网络通讯稳定性,你们现在都用啥控件,如果有满意的Demo将再加100分
- TreeView1.Selected.Delete 后 PopupMenu弹不出来 有点好几次右键才出来 这是啥回事?
- 急,怎樣解決這個的報表,解決馬上給分
- 用idmessage提交邮件问题
- 如何用DELPHI将SQL SERVER里的数据导出成html格式?---在线急等啊!!!!
- 请教!一套人事管理软件应该包括那些功能!小弟初学编程,对人事管理不太清楚,希望大虾们各抒己见!
- 如何清空和备份数据库
- 有关创建Component的问题。
- 有关TTreeView的data属性的问题
- 我想知道一些关于记录的问题(type Record)希望大家帮助!
- 用Delphi在Access中插入时间。
- 请教:经理要求程序中的COM模块注册到对象运行表中
你的代码没有问题
请试试用一个按钮来处理这个事件
procedure TForm1.ComboBox1DropDown(Sender: TObject);
begin
table1.First ();
while not table1.Eof do
begin
combobox1.Items.Add(table1.FieldByName('NAME').AsString);
table1.Next;
end;
end;