with frmdm.qryrep do
begin
first;
while not eof do
begin
cbxCommu.Items.Add(fieldvalues['Community']);
next;
end;
end;
begin
first;
while not eof do
begin
cbxCommu.Items.Add(fieldvalues['Community']);
next;
end;
end;
解决方案 »
- Delphi Spring Framework V0.2.0 is released!
- 动态创建TDataSetField问题
- delphi VFP adoquery.savetofile???
- SQL语句在sqlserver测试没问题,加到ADOQuery1.SQL.add方法后就不行了
- CoolBar中控件的位置
- VB代码转DELPHI,相信很多人都在找 -- HOWTO:为 Office 命令栏按钮创建透明图片
- 请教GlobalSCAPE中的那个队列框是如何实现的???
- WebBrowser1粘贴问题
- 有关float to 4Btye的算法转换
- 请教高手一个数据库方面的问题
- .VCD是什么类型的文件?用什么程序打开?
- 求解dataset.cancel,dataset.cancelupdates,dataset.cancelBatch,有什么区别??
begin
CbxCommu.Items.Add(frmdm.qryrep.fieldvalues['Community']);
frmdm.qryrep.next;
end;
var
sSql, sValue: string;
begin
combobox1.clear;
sSql := 'select distinct Community from table1';
//问题可能出在这里'distinct'
Query1.close;
Query1.Sql.clear;
Query1.Sql.add(sSql);
Query1.open;
Query1.first;//移动到数据集的最前;
while not Query.eof do
begin
sValue := Query1.fieldbyValues['Community'];
combobox1.items.add(sValue);
end;
end;
var
sSql, sValue: string;
begin
combobox1.clear;
sSql := 'select distinct Community from table1';
//问题可能出在这里'distinct'
Query1.close;
Query1.Sql.clear;
Query1.Sql.add(sSql);
Query1.open;
Query1.first;//移动到数据集的最前;
while not Query.eof do
begin
sValue := Query1.fieldbyValues['Community'];
combobox1.items.add(sValue);
end;
end;
我是谁写的代码是一个死循环,除非query没有记录,不然就死在循环中了。