Home

The Exhibition

Photos

<% Function FormatStr(Str) Str="" & Str Str=Replace(Str, CHR(13), "") Str=Replace(Str, CHR(10) & CHR(10),"

") Str=Replace(Str, CHR(10), "
") FormatStr = Str End Function 'Dimension variables Dim adoCon 'Holds the Database Connection Object Dim rsGallery 'Holds the recordset for the records in the database Dim strSQL 'Holds the SQL query to query the database Set adoCon = Server.CreateObject("ADODB.Connection") adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../data/quonset2005.mdb") Set rsGallery = Server.CreateObject("ADODB.Recordset") xID = Request.QueryString("id") If xID <> "" then %>

back
<% strSQL = "SELECT * FROM Gallery WHERE ID =" & xID & ";" rsGallery.Open strSQL, adoCon if not rsGallery.EOF then %>
.jpg" />
<% if rsGallery("Credit") <> "" Then Response.Write ("

Photo Credit: " & rsGallery("Credit") & "

") end if end if Else %>
<% strSQL = "SELECT * FROM Gallery WHERE Category = 'exhibit' AND Active = true;" rsGallery.Open strSQL, adoCon Do While not rsGallery.EOF %> <% rsGallery.MoveNext Loop End If 'Reset server objects rsGallery.Close Set rsGallery = Nothing Set adoCon = Nothing %>