with query1 do
begin
....
query1.open;
with not eof do
begin
combobox1.items.add(inttostr(query1.fieldbyname('code').asinteger));//如果是字符类型的combobox1.items.add(query1.fieldbyname('code').asstring)
next;
end;
end;
begin
....
query1.open;
with not eof do
begin
combobox1.items.add(inttostr(query1.fieldbyname('code').asinteger));//如果是字符类型的combobox1.items.add(query1.fieldbyname('code').asstring)
next;
end;
end;
解决方案 »
- 用登陆窗口进去之后调用主窗口,然后主窗口再调用另一个窗口Show
- 求建议:“工作半年了,觉得用本科生的身份混下去,前途不会太好,打算考研!”顺便散分。
- 300分求助,Delphi如果调用VC写的DLL来完成磁卡读写器的操作
- SOS!奇怪问题,请奇怪高手帮忙,自启动程序的图标在哪?
- 请教:详细介绍 构造、析构、重载、虚函数、消息、句柄几个概念含义 并用代码示例
- 请问如何只用delphi而不使用任何安装工具制作单文件的安装程序?
- Socket编程的奇怪错误,请大家一定帮忙,我找不到问题在哪里
- 大虾请进----------这个相似度算法如何改?-----------
- 有点错误请高手指点---急急急---高分
- 请教各位大虾!用 Qreport 打印报表,如何自定义纸张大小!多谢!
- 这个问题谁能答好,再给500分
- 姚明成为NBA状元秀,不知道前途如何
begin
First;
while not Eof do
begin
ComboBox1.Items.Add(IntToStr(FieldByName('code').AsInteger));
Next;
end;
end;
begincombobox1.items.clear;
with query1 do
begin
close;
sql.clear;
sql.add(' select Code from table ');
Open;
while not eof do
begin
combobox1.items.add(inttostr(fieldbyanem('code').asinteger));
Next;
end;
end;
end;
begin
....
query1.open;
with not eof do
begin
combobox1.items.add(inttostr(query1.fieldbyname('code').asinteger));//如果是字符类型的combobox1.items.add(query1.fieldbyname('code').asstring)
next;
end;
end;
类似于这样的问题,楼主是否能快点结呢,因为答案已经贴出?
TDBLookupListBox
只要指定相关属性即可.
属性KeyField: 指定键值
属性ListField: 指定要显视的值
设置一下keyfield,listfield,和listdatasource就可以了
datafield和datasource为空
行行好,帮帮我这可怜的人吧