Dim statCurrYear
Dim statCurrMonth
Dim statCurrDay
Dim statCurrHour
Dim intCoolInt 'S
Dim intCoolInt2 'pv
statCurrYear = year(now())
statCurrMonth = month(now())
statCurrDay = day(now())
statCurrHour = hour(now())
'Do statistics
strSQL = "SELECT * from tblStats WHERE statYear = " & statCurrYear & " AND statMonth = " & statCurrMonth & " AND statDay = " & statCurrDay & " AND statHour = " & statCurrHour
rsCommon.open strSQL, adoCon
'Create if none exist
If rsCommon.eof or rsCommon.bof then
rsCommon.close
strSQL = "INSERT INTO tblStats (statYear,statMonth,StatDay,StatHour,sessions,pageViews) VALUES (" & statCurrYear & "," & statCurrMonth & "," & statCurrDay & "," & statCurrHour & ",0,0)"
rsCommon.open strSQL, adoCon
else
intCoolInt = rsCommon("sessions")
intCoolInt2 = rScommon("pageViews")
intCoolInt = intCoolInt+1
intCoolInt2 = intCoolInt2+1
rsCommon.close
end if
strSQL = "UPDATE tblStats SET pageViews = " & intCoolInt2
If isEmpty(Session("blnCounterSet")) = True Then
strSQL = strSQL + (", sessions = " & intCoolInt)
end if
strSQL = strSQL + (" WHERE statYear = " & statCurrYear & " AND statMonth = " & statCurrMonth & " AND statDay = " & statCurrDay & " AND statHour = " & statCurrHour)
rsCommon.open strSQL, adoCon
'Total session count
If isEmpty(Session("blnCounterSet")) = True Then
strSQL = "UPDATE tblConfiguration SET sessions = " & lngSessions + 1
rscommon.open strSQL, adoCon
Session("blnCounterSet") = True
End if
strSQL = "UPDATE tblConfiguration SET pageviews = " & lngPageViews + 1
rscommon.open strSQL, adoCon
%>