....
ADOQuery1.SQL.ADD('Selcet zch from A');
ADOQuery1.open;
ADOquery1.FindFrist;
Repeat
begin
Case ADOQuery1.FieldByName('zch').Asstring of
'001': .....
end;
ADOQuery1.FindNext;
Until ADOQuery1.Eof = True
.......
query.sql.add('select distinct zch from A');
query.open;
while not query.eof do
begin
b[query.fields[0].asinteger]:=query.fields[0].asstring;
query.next;
end;