%
Option Explicit
Response.Buffer = true
Response.Expires = 0
%>
Home
Click here for the contact form
<%
sub listLocations()
Dim conn
Dim rst
Dim str
Dim aDict
Set aDict = Server.CreateObject("Scripting.Dictionary")
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = Application("ConnectString")
conn.open
' Select categories that are not subcategories
str = "Select * from Locations order by Address2;"
Call readRecordsetData(conn, rst, str) ' readonly rst
Set rst.ActiveConnection = Nothing
while not(rst.EOF)
response.Write("
")
response.Write(" | | " & vbcrlf)
Call readAndFillDict(conn, rst, aDict)
Call writeOneLocation(aDict)
response.Write(" | " & vbcrlf)
Call readAndFillDict(conn, rst, aDict)
Call writeOneLocation(aDict)
response.Write(" | " & vbcrlf)
response.Write("
" & vbcrlf)
'rst.MoveNext
wend
rst.Close
conn.Close
end sub
sub readAndFillDict(byref conn, byref rst, byref aDict)
Dim n
if not(rst.EOF) then
Call fillDict(conn, rst, aDict)
rst.MoveNext
else
for n=0 to 9
aDict(n) = ""
next
end if
end sub
sub fillDict(byref conn, byref rst, byref aDict)
aDict.RemoveAll
aDict(0) = imageTagFromID(conn, rst("LogoPictureID"), "")
aDict(1) = rst("Name")
aDict(2) = rst("Address1")
'Brad added: Do not display address2 it is for ordering records
aDict(3) = ""
'aDict(3) = rst("Address2")
aDict(4) = rst("City") & ", " & rst("State") & " " & rst("Zipcode")
aDict(5) = "Phone: " & rst("Phone1")
if (rst("Phone2") <> "") then
aDict(6) = "Phone: " & rst("Phone2")
else
aDict(6) = ""
end if
aDict(7) = "Fax: " & rst("Fax")
if (rst("Email") <> "") then
aDict(8) = "" & rst("Email") & "" & vbcrlf
else
aDict(8) = ""
end if
if (rst("MapquestURL") <> "") then
aDict(9) = "View Map" & vbcrlf
else
aDict(9) = ""
end if
end sub
sub writeOneLocation(byref aDict)
Dim n
response.Write(" ")
response.Write(" | " & aDict(0) & " " & vbcrlf) ' write logo
response.Write(" " & aDict(1) & " " & vbcrlf) ' write name
for n = 2 to 9
if (aDict(n) <> "") then
response.Write( aDict(n) & " " & vbcrlf)
end if
next
response.Write(" ")
response.Write(" | " & vbcrlf)
end sub
%>
<% Call listLocations() %>