%
Const ForReading = 1, ForWriting = 2
dim fs
set fs = Server.CreateObject("Scripting.FileSystemObject")
dim MyFile
MyFile = Server.MapPath("count.txt")
dim txtfile
set txtfile = fs.OpenTextFile(MyFile,ForReading,False)
dim strText
strText = txtfile.ReadAll
txtfile.Close
set txtfile = Nothing
set txtfile = fs.OpenTextFile(MyFile,ForWriting,False)
count = CInt(strText)
count = count + 1
strText = CStr(count)
txtfile.Write strText
txtfile.Close
%>
Phoebus - News
<%Dim Conn, RS
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
DSNName = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
DSNName = DSNName & Server.MapPath("/data/news.mdb")
Conn.Open DSNName
sql = "select title, publishdate, ID from News Order By publishdate DESC, ID"
'response.Write(sql)
'response.End()
RS.Open sql, Conn, 3, 3%>
www.phoebussoftware.com
News
<%
If not RS.BOF and not RS.EOF then
RS.MoveFirst
Do Until RS.EOF
if RS.Fields("publishdate").Value = publishdate then
'dont display region header as it has already been displayed.
else
strMonth = ConvDate(RS.Fields("publishdate").Value, "%b")
strYear = ConvDate(RS.Fields("publishdate").Value, "%Y")
%><% Response.Write(strMonth) %> <% Response.Write(strYear) %>
<%
end if
publishdate = RS.Fields("publishdate").Value
%><% Response.Write(RS.Fields("title").Value)%>
<% 'If RS.Fields("link").Value !="" then %>
">....More