q = "select tblArea,tblCompany " _
& "from areas left join groups on areas.id = groups.tblAreaId " _
& " order by tblArea"
pa = ""
set rs = connect.execute(q)
while not rs.eof
if pa <> rs("TBLAREA") then
pa = rs("TBLAREA")
response.write pa & "<br>"
end if
if "" & rs("TBLCOMPANY") <> "" then
response.write rs("TBLCOMPANY") & "<br>"
end if
rs.movenext
wend