%@CODEPAGE="65001"%> <% reportFlag = false tmpDate = date tmpY = year(tmpDate) tmpM = month(tmpDate) tmpD = day(tmpDate) reportCount=0 if Request.Cookies("VISTED") <> "" then reportCount=cint(Request.Cookies("VISTED")) else strSql = "select reportId,reportCount from report where reporty=" & tmpY & " and reportm=" & tmpM set rs = server.CreateObject("adodb.recordset") rs.open strSql,conn,1,1 if not rs.eof then reportCount = rs("reportCount") reportId = rs("reportId") reportFlag = true end if set rs = nothing reportCount=reportCount + 1 if reportFlag then strSql = "update report set reportCount=reportCount + 1 where reportId=" & reportId conn.execute strSql reportCount=reportCount else strSql = "insert into report(reporty,reportm,reportcount) values(" & tmpY & "," & tmpM & ",1)" conn.execute strSql end if Response.Cookies("VISTED") = reportCount end if %>
|
|