请我如下写应该怎么改:
SQLCode := ' set rowcount 0 select cata,cata2 from law..Law_Info';
SQL.Add(SQLCode);
open;
if not MyQuery.IsEmpty then
while not MyQuery.Eof do
begin
for i:=0 to ComboBox1.itemindex - 1 do
ComboBox1.AddItem(FieldByName('cata').AsString);
i := i + 1;
end;
另问:如何不让表中查找出来的字段不重复!谢谢各位了!
SQLCode := ' set rowcount 0 select cata,cata2 from law..Law_Info';
SQL.Add(SQLCode);
open;
if not MyQuery.IsEmpty then
while not MyQuery.Eof do
begin
for i:=0 to ComboBox1.itemindex - 1 do
ComboBox1.AddItem(FieldByName('cata').AsString);
i := i + 1;
end;
另问:如何不让表中查找出来的字段不重复!谢谢各位了!
解决方案 »
- 刚在http://bsalsa.com/下了最新版的EmbeddedWB,看了EWBTools.pas设置代理的代码飙汗。。。
- 界面的求教
- QUERY问题,高手请进!如何用label将这三条数据同时显示出来呢?
- 快救命,一个超难问题!
- 简单的查询问题,谢谢
- 如何计算memo中的字数的个数
- 一个简单的价值问题
- 我是一个delphi的新手,能不能介绍我一个入门的书,最好是电子读书,谢谢
- 关于ado对sqlserver2000的image字段的错误
- Delphi控件
- 请问我在两个datetimepicker控件中分别选择日期,想取两个日期之间相差几天,怎么做呀?谢谢!
- 用下载的问题:用代理上网是不是BT用不成了,怎么办??
SQL.Add(SQLCode);
open;
if not MyQuery.IsEmpty then
while not MyQuery.Eof do
begin
ComboBox1.AddItem(FieldByName('cata').AsString);
end;select distinct() from
SQLCode := ' set rowcount 0 select cata,cata2 from law..Law_Info';
SQL.Add(SQLCode);
open;
if not MyQuery.IsEmpty then
while not MyQuery.Eof do
begin
for i:=0 to myquery.recordcount-1 do
if DBCom.Items.IndexOf(FieldByName('cata').AsString)<0 then
ComboBox1.Items.add(FieldByName('cata').AsString);
end;
SQLCode := ' set rowcount 0 select cata,cata2 from law..Law_Info';
SQL.Add(SQLCode);
open;
ComboBox.items.clear;
for i:=0 to myquery.recordcount-1 do
if DBCom.Items.IndexOf(FieldByName('cata').AsString)<0 then
ComboBox1.Items.add(FieldByName('cata').AsString);
begin
close;
sql.Clear;
sql.Add('select unitname from T_B_unit');
open; combobox1.Clear;
while not Eof do
begin
combobox1.Items.Add(FieldByName('UnitName').AsString);
next;
end;
end;调试通过
SQL.Add(SQLCode);
open;
ComboBox.items.clear;
for i:=0 to myquery.recordcount-1 do
if Combobox1.Items.IndexOf(FieldByName('cata').AsString)<0 then//有就不加入
ComboBox1.Items.add(FieldByName('cata').AsString);
SQL.Add(SQLCode);
open;
ComboBox1.Items.clear;
if not MyQuery.IsEmpty then
while not MyQuery.Eof do
begin
for i:=0 to myquery.recordcount-1 do
if DBCom.Items.IndexOf(FieldByName('cata').AsString)<0 then
ComboBox1.Items.add(FieldByName('cata').AsString);
end;
試試吧!