combobox1.clear; with AdoQuery1 do begin close; sql.clear; sql.add('select distinct 供应商编号 from 供货商信息表'); Open; while not eof do comboBox1.Items.add(FieldByName('供应商编号').asString); end; with adoQuery1 do begin close; sql.clear; sql.text:= 'select * from 供货商信息表 where 供应商编号='''+ combobox1.text + ''''; Open; if eof then //没有此编号 else ;//有。 end;
//改一下 with adoQuery1 do begin close; sql.clear; sql.text:= 'select * from 供货商信息表 where 供应商编号='''+ combobox1.text + ''''; Open; if recordCount =0 then //没有此编号 else ;//有。 end;
with AdoQuery1 do
begin
close;
sql.clear;
sql.add('select distinct 供应商编号 from 供货商信息表');
Open;
while not eof do
comboBox1.Items.add(FieldByName('供应商编号').asString);
end;
with adoQuery1 do
begin
close;
sql.clear;
sql.text:= 'select * from 供货商信息表 where 供应商编号='''+ combobox1.text + '''';
Open;
if eof then
//没有此编号
else
;//有。
end;
with adoQuery1 do
begin
close;
sql.clear;
sql.text:= 'select * from 供货商信息表 where 供应商编号='''+ combobox1.text + '''';
Open;
if recordCount =0 then
//没有此编号
else
;//有。
end;