大家帮忙看一下如何屏蔽组合框的数据查询的重复值?
yafun 2002-05-14 05:50:00 procedure TForm4.DBLookupComboBox1CloseUp(Sender: TObject);
var
htbh1:string;
ifield:integer;
begin
combobox1.Clear;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select phcrno from 1');
adoquery1.SQL.Add('where pvend=:mfdm');
adoQUERY1.Parameters.ParamByName('mfdm').Value:=dblookupcombobox1.KeyValue;
if adoquery1.Prepared = False then
begin
adoquery1.Prepared := True;
end;
adoquery1.Open;
with adoquery1 do begin
open;
first;
for ifield:=0 to adoquery1.RecordCount-1 do begin
htbh1 := adoquery1.Fields[0].Value;
next;
combobox1.Items.Append(htbh1);//此处显示的有许多重复值,不知该如何写?
end;
end;
end;