% option explicit %> <% dim oConn set oConn = server.createobject("adodb.connection") oConn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("/db/kcrhca.mdb") & ";" %> <% dim oRs dim aRs dim rr dim sql dim organization, rep_name, address1, address2, city, state, zip, phone, fax, website, email, category dim firstletter, prevletter dim prev_org dim output on error resume next sql = "SELECT organization, rep_name, address1, address2, city, state, zip, phone, fax, website, email, category " sql = sql & "FROM member_directory " if request.form("category") <> "" then sql = sql & "WHERE category = '" & request.form("category") & "' " end if sql = sql & "ORDER by organization " set oRs = oConn.execute(sql) if not oRs.eof then aRs = oRs.getrows() set oRs = nothing prevletter = "" firstletter = "a" prev_org = "" for rr = 0 to ubound(aRs,2) organization = aRs(0,rr) rep_name = aRs(1,rr) address1 = aRs(2,rr) address2 = aRs(3,rr) city = aRs(4,rr) state = aRs(5,rr) zip = aRs(6,rr) phone = aRs(7,rr) fax = aRs(8,rr) website = aRs(9,rr) email = aRs(10,rr) category = aRs(11,rr) firstletter = ucase(left(organization,1)) if firstletter <> prevletter then output = output & "" & chr(10) end if if prev_org <> organization then output = output & "
| " & chr(10)
output = output & " " & organization & " " & chr(10) output = output & " " & rep_name & " | " & chr(10)
output = output & " " & address1 & " " & chr(10) if len(address2) then output = output & " " & address2 & " " & chr(10) end if output = output & " " & city & ", " & state & " " & zip & " " & chr(10) output = output & " Phone " & phone & " " & chr(10) output = output & " Fax " & fax & " " & chr(10) if len(website) > 7 then output = output & " Website: " & website & " | " & chr(10)
end if
'output = output & " Email: " & email & "" & chr(10)
output = output & "
|