<% Const TristateFalse = 0
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8 %>
<% Set fsoDates = Server.CreateObject("Scripting.FileSystemObject") %>
<% If Not(fsoDates.FileExists(Server.MapPath("counters/dyk.txt"))) Then %>
<% Set filDyk = fsoDates.CreateTextFile(Server.MapPath("counters/dyk.txt")) %>
<% End If %>
<% Set filDyk = fsoDates.GetFile(Server.MapPath("counters/dyk.txt")) %>
<% Set txtDyk = filDyk.OpenAsTextStream(ForReading, TristateFalse) %>
<% If Not(txtDyk.AtEndOfStream) Then %>
<% strDate = txtDyk.ReadLine %>
<% If Not(txtDyk.AtEndOfStream) Then %>
<% strLast = txtDyk.ReadLine %>
<% End If %>
<% End If %>
<% txtDyk.Close %>
<% If cDate(strDate) <> Date Then %>
<% strDate = Date
strLast = strLast + 1 %>
<% End If %>
<% strSQL = "SELECT * FROM [dyk] WHERE [ID] = " & strLast %>
<% Set rsDyk = Server.CreateObject("ADODB.RecordSet") %>
<% rsDyk.Open strSQL, connDates, adOpenStatic %>
<% If rsDyk.EOF Then %>
<% rsDyk.Close %>
<% strLast = 1 %>
<% strSQL = "SELECT * FROM [dyk] WHERE [ID] = " & strLast %>
<% rsDyk.Open strSQL, connDates, adOpenStatic %>
<% If rsDyk.EOF Then %>
None
<% Else %>
<% Response.Write rsDyk("Dyk") & " " %>
<% End If %>
<% Else %>
<% Response.Write rsDyk("Dyk") & " " %>
<% End If %>
<% rsDyk.Close %>
<% Set rsDyk = Nothing %>
<% Set filDyk = fsoDates.GetFile(Server.MapPath("counters/dyk.txt")) %>
<% Set txtDyk = filDyk.OpenAsTextStream(ForWriting, TristateFalse) %>
<% txtDyk.WriteLine strDate %>
<% txtDyk.WriteLine strLast %>
<% txtDyk.Close %>
<% Set fsoDates = Nothing %>
|
|