<% Dim strURL Dim cnnSearch Dim rstSearch Dim ContSearch Dim strDBPath Dim strSQL Dim CustCont Dim strSearch Dim today Dim intPageCount Dim intRecordCount Dim intPage Dim intRecord Dim intStart ' The record that we are starting on. Dim intFinish today = Date() strURL = Request.ServerVariables("URL") strSearch = Request.QueryString("search") If Request.QueryString("search") = "" then Response.Redirect ("index.asp?search=%25") Response.End End If ' Check to see if there is value in the NAV querystring. If there ' is, we know that the client is using the Next and/or Prev hyperlinks ' to navigate the recordset. If Request.QueryString("NAV") = "" Then intPage = 1 Else intPage = Request.QueryString("NAV") End If %> LDS Sunderland 5k Photos

 

 

<% Set cnnSearch = Server.CreateObject("ADODB.Connection") cnnSearch.Open "Provider=sqloledb;Data Source=winsqleu02.1and1.co.uk,1433;Initial Catalog=db238890171;User Id=dbo238890171;Password=Zj3fQzM8;", adOpenStatic strSQL = "SELECT id, url, description, fileext " _ & "FROM s5kphotos " _ & "ORDER BY s5kphotos.id ;" Set rstSearch = cnnSearch.Execute(strSQL) 'Open the recordset Set rstSearch = Server.CreateObject("ADODB.Recordset") rstSearch.CursorLocation = 3 'adUseClient rstSearch.CursorType = adOpenStatic rstSearch.ActiveConnection = cnnSearch rstSearch.Open strSQL rstSearch.pageSize = 1 rstSearch.CacheSize = rstSearch.PageSize intPageCount = rstSearch.PageCount intRecordCount = rstSearch.RecordCount If CInt(intPage) > CInt(intPageCount) Then intPage = intPageCount If CInt(intPage) <= 0 Then intPage = 1 If intRecordCount > 0 Then rstSearch.AbsolutePage = intPage intStart = rstSearch.AbsolutePosition If CInt(intPage) = CInt(intPageCount) Then intFinish = intRecordCount Else intFinish = intStart + (rstSearch.PageSize - 1) End if End If %> <% If strSearch <> "" Then %> <% If strSearch = "%" then strSearch = strSearch & "25" End if %> <%If intRecordCount > 0 Then ' Display the record that you are starting on and the record ' that you are finishing on for this page by writing out the ' values in the intStart and the intFinish variables. %>
You are now viewing image <%=intStart%> of <%=intRecordCount%>

<% For intRecord = 1 to rstSearch.PageSize %> <% urlid = rstSearch.Fields("id").Value %>
<% response.Write "

Write a comment...

" %>

<% releaseTxt = (rstSearch.Fields.Item("description").Value) If releaseTxt <> "" Then releaseTxt = replace(releaseTxt, CHR(10), CHR(10) & " 
") releaseTxt = replace(releaseTxt, CHR(163), CHR(163) & "£") releaseTxt = replace(releaseTxt, CHR(128), CHR(128) & "€") response.Write releaseTxt response.Write "

Write a comment...

" End If %>


<% Set Dataconn = Server.CreateObject("ADODB.Connection") Dataconn.Open "Provider=sqloledb;Data Source=winsqleu02.1and1.co.uk,1433;Initial Catalog=db238890171;User Id=dbo238890171;Password=Zj3fQzM8;", adOpenStatic strSQL = "SELECT id, name, date, time, IDcomment, comment " _ & "FROM s5kcomments " _ & "WHERE IDcomment LIKE '%" & Replace(urlid, "'", "''") & "%' " _ & "ORDER BY comments.date desc ;" Set rsDsp = DataConn.Execute(strSQL) Set RS = Server.CreateObject("ADODB.Recordset") If rsDsp.EOF Then Response.Write "Be the first to comment on this picture..." Response.Write "

 

" Else %> <% While Not rsDsp.EOF x = x + 1 If x = 1 Then Response.Write "" & rsDsp("date").Value & "  " & rsDsp("time").Value & "
" Response.Write "" & rsDsp.Fields.Item("Name").Value & " commented:
" Response.Write "" & rsDsp("comment").Value & "
" Response.Write "
" Else Response.Write "" & rsDsp("date").Value & "  " & rsDsp("time").Value & "
" Response.Write "" & rsDsp.Fields.Item("Name").Value & " commented:
" Response.Write "" & rsDsp("comment").Value & "
" Response.Write "
" x = 0 End If rsDsp.MoveNext Wend ' RS.Close DataConn.Close End If %> <% ' Iterate through the recordset until we reach the end of the page ' or the last record in the recordset. 'Response.Write "" & rstSearch.Fields("header").Value & "" rstSearch.MoveNext If rstSearch.EOF Then Exit for Next %>
<% ' Check to see if the current page is greater than the first page ' in the recordset. If it is, then add a "Previous" link. If cInt(intPage) > 1 Then %> Previous    <%End IF%> <% ' Check to see if the current page is less than the last page ' in the recordset. If it is, then add a "Next" link. If cInt(intPage) < cInt(intPageCount) Then %> Next <%End If%>

 

<%Else%>
No Records Found
<%End If%> <%End If%>