<%
Option Explicit
Response.Expires = -1000
%>
<!--#INCLUDE file="constants.asp" -->
<%
'======================================================================
' This ASP script en database has been made by Martijn ten Napel
' homepage: http://www.noipo.org
' This script is freeware and you can twist and turn it to your liking.
'======================================================================


Dim objConn
Dim objRecordSet
Dim strID
Dim strSQL

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(LOCATION))

strSQL = "SELECT refernr, volgnr, author, date, email, homepage, comment FROM COMMENTS ORDER BY date DESC"

Set objRecordSet = objConn.Execute(strSQL)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
	<title>comments readout page</title>
	<style type="text/css">
	body {
		font : 14px Georgia;
	}
	.header {
		color : Gray;
		font-size : 11px;
		padding-top : 30px;
	}
	blockquote {
		border-left : 1px solid Gray;
		padding-left : 10px;
	}
	.comment {
		padding-left : 50px;
		width : 400px;
		padding-top : 15px;
	}
	h1 {
		color : Gray;
		font-size : 20px;
	}
</style>
</head>

<body>
<h1>Readout page of comments</h1>
<%

if (objRecordSet.BOF And objRecordSet.EOF) then
	response.write "<p>[no comments yet]</p>"
else
	Do While NOT objRecordSet.EOF 

	response.write "<p class=""header"">" & objRecordSet("date").Value & " - blog ID: " & objRecordSet("refernr").Value & "</p>"
	response.write "<blockquote>"
	response.write vbTAB & "auteur: " & objRecordSet("author").Value & "<br>" & vbCRLF
	if len(objRecordSet("homepage").Value) > 1 then
		response.write vbTAB & "homepage: <a href=""" & objRecordSet("homepage").Value & """ target=""_blank"">" & objRecordSet("homepage").Value & "</a><br>" & vbCRLF
	else 
		response.write vbTAB & "homepage: <em>geen</em><br>" & vbCRLF
	end if
	if len(objRecordSet("email").Value) > 1 then
		response.write vbTAB & "e-mail: <a href=""mailto:" & objRecordSet("email").Value & """>" & objRecordSet("email").Value & "</a><br>" & vbCRLF
	else
		response.write vbTAB & "e-mail: <em>geen</em><br>" & vbCRLF
	end if
	response.write vbTAB & "<div class=""comment"">" & objRecordSet("comment").Value & "</div>" & vbCRLF & "</blockquote>" & vbCRLF
	
	objRecordSet.MoveNext
	Loop
end if

objConn.Close
Set objRecordSet = Nothing
Set objConn = Nothing

%>

</body>
</html>