<%
Sub ShowListing(varSubCategory)
dim conn
dim strconn
dim photoconn
dim strphotoconn
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & _
Server.MapPath("cms/betco/betco.mdb") 'change the path as necessary
set conn = server.createobject("adodb.connection")
conn.open strconn
SQL = "SELECT * FROM content WHERE subid = " & varSubCategory & ""
set oRs = conn.Execute(SQL)
If oRs.EOF then
Response.Write "This category is empty"
Else
oRS.MoveFirst
Do While Not oRS.EOF
strphotoconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & _
Server.MapPath("cms/betco/betco.mdb") 'change the path as necessary
set photoconn = server.createobject("adodb.connection")
photoconn.open strphotoconn
photoSQL = "SELECT * FROM photos WHERE contentid = " & oRS.Fields("contentid") & ""
set photoRS = photoconn.Execute(photoSQL)
If photoRS.EOF then
Response.Write "There is no photo for this category"
Else
photoRS.MoveFirst
Do While Not photoRS.EOF
If oRS.Fields("content") = "NULL" Then
varContent = " "
Else
varContent = oRS.Fields("content")
End If
%>
<div>
<div><A HREF="javascript:PopupPic('cms/betco/images/thumbs/large_<% =photoRS.Fields("photoname") %>')">
<img title="<% =varContent %>" src="cms/betco/images/thumbs/small_<% =photoRS.Fields("photoname") %>" border="0" style="border: 1px solid #000000;">
</a></div>
<div><strong><% =photoRS.Fields("caption") %></strong></div>
</div>
<br />
<%
photoRS.MoveNext
Loop
End If
set photoconn = Nothing
set photoRS = Nothing
' Get next record
oRS.MoveNext
Loop
End If
Set conn = Nothing
Set oRs = Nothing
End Sub
Sub ShowNews(varNumItems)
dim newsConn
dim newsstrConn
newsstrConn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & _
Server.MapPath("cms/betco/betco.mdb") 'change the path as necessary
set newsConn = server.createobject("adodb.connection")
newsConn.open newsstrConn
if isNumeric(varNumItems) then
varNumItems = CInt(varNumItems)
newsSQL = "SELECT TOP " & varNumItems & " * FROM press ORDER BY id DESC"
else
varNumItems = CStr(varNumItems)
if varNumItems = "ALL" then
newsSQL = "SELECT * FROM press"
End If
End If
set newsRS = newsConn.Execute(newsSQL)
If newsRS.EOF then
Response.Write "There are no news items to display"
Else
Response.Write "<p style=""font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color: #000000;"">"
Response.Write " News Releases</p>"
newsRS.MoveFirst
Do while not newsRS.EOF
%>
<p style="margin-left: 5px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold;"><a href="news.asp?id=<% =newsRS.Fields("id") %>"><% =newsRS.Fields("headline") %></a></p>
<%
newsRS.MoveNext
Loop
End If
End Sub
%>