%@ LANGUAGE="VBScript" %>
<%
on error resume next
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
'*** Phisycal path of your web root folder
'rootPath = Server.MapPath("/")
'dbPath = Replace(rootPath, "\www", "\database")
dbPath = "D:\Domains\pratie.com\wwwroot\feature\steeple\steeple.mdb"
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & dbPath
conn.Open strCon
If err.number <> 0 then
'response.redirect "dbdown.html"
conn.Close
Set conn = nothing
response.end
End if
dim strID
strID = trim(Request.Querystring("strID"))
if strID = "" then
strID="intro"
else
If IsNumeric(strID) = false then
response.write "You entered a non-numeric photo id. Please use the next and previous buttons to flip through the photographs.
Please go back or go to the photo index page."
response.end
elseif strID < 1 or strID > 16 then
response.write "You entered an invalid photo id. Please use the next and previous buttons to flip through the photographs.
Please go back or go to the photo index page."
response.end
end if
strID=strID
End If
If strID <> "intro" then '-------------------------------------------------------------
conn.Open strCon
strAction1=strID-1
strAction2=strID+1
Set rsDetail=Server.CreateObject("ADODB.Recordset")
Set rsTot=Server.CreateObject("ADODB.Recordset")
rsDetail.Open "SELECT fid,image,date FROM tblimages where fid="&strID,conn,0,3
rsTot.Open "SELECT * FROM abfTotal",conn,0,3
strTotal=rsTot.Fields("Total")
rsTot.Close
if rsDetail.Fields("fid")=strTotal then
strEnd=true
end if
if strAction1<>0 then
strPrev="
"
else
strPrev="
"
end if
if strEnd=true then
strNext="
"
else
strNext="
"
end if
strHome="
"
strToTImages=rsDetail.Fields("fid")&" of "&strTotal
strImage="
"
rsDetail.Close
conn.Close
Set conn = Nothing
Else '-------------------------------------------------------------
Const adOpenStatic = 3
Const adCmdText = &H0001
dim objRS
dim strSQL
dim intSize
dim intOtherSize
dim strLayoutType
dim strOrientation
dim intNumRecs
dim intNumCols
dim intNumRows
dim intRowIndex
dim intColIndex
dim intPosition
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.ActiveConnection = strCon
strSQL = "SELECT fid,image,date FROM tblimages"
objRS.Open strSQL, ,adOpenStatic , , adCmdText
end if
%>
Old First Reformed Church Steeple -- Park Slope, Brooklyn
<% If strID = "intro" then %>
<%
If objRS.EOF Then
Response.Write "No records in the database."
Else
'retrieve parameters
intSize = "7"
strOrientation = "V"
strLayoutType = "R"
Response.Write " " & vbCRLF
'get the number of records in the database
intNumRecs = objRS.RecordCount
'get other dimension of the table
If intNumRecs Mod intSize = 0 Then
intOtherSize = intNumRecs / intSize
Else
intOtherSize = Int((intNumRecs / intSize)) + 1
End If
'set variables for table size
intNumRows = intSize
intNumCols = intOtherSize
'loop thru table by row
For intRowIndex = 1 To intNumRows
Response.Write "" & vbCRLF
intPosition = intRowIndex
'loop thru table by column
For intColIndex = 1 To intNumCols
PrintRecord
intPosition = intPosition + intNumRows
Next
Response.Write " " & vbCRLF
Next
Response.Write " " & vbCRLF
End If
'clean up and close the database
objRS.Close
Set objRS = Nothing
sub PrintRecord
'if position is past EOF print a blank cell
If intPosition > intNumRecs Then
Response.Write " | " & vbCRLF
Else
objRS.AbsolutePosition = intPosition
'if necessary, check for blank field values and print blank cell
If objRS.Fields("fid") = "" Then
Response.Write " | " & vbCRLF
Else
Response.Write " " & ucase(objRS.Fields("date").Value) & " | "
End If
End If
End Sub
%>
|
<% Else %>
<%=strImage%> |
<%=strHome%> |
<%=strPrev%> |
<%=strToTImages%> |
<%=strNext%> |
|
|
<% End If %>
|