str1:='小红';
adoquery1.close;
adoquery1.sql.text:='select * from table where name='''+str1+'''';
adoquery1.open;
if adoquery1.recordcount>0 then
begin
age:=adoquery1.fieldByName('年龄').asinteger;
phone:=adoquery1.fieldByName('手机号').asString;
job:=adoquery1.fieldByName('工作').asString;
qq:=adoquery1.fieldByName('QQ号').asString;
end;
adoquery1.close;
adoquery1.sql.text:='select * from table where ID>0 and ID<17 order by ID';
adoquery1.open;
if adoquery1.recordcount>0 then
begin
while not adoquery1.eof do
begin
age:=adoquery1.fieldByName('年龄').asinteger;
phone:=adoquery1.fieldByName('手机号').asString;
job:=adoquery1.fieldByName('工作').asString;
qq:=adoquery1.fieldByName('QQ号').asString;
adoquery1.next;
end;
end;