<% mode = LCASE(Request("mode")) Set conn = Server.CreateObject("ADODB.Connection") DBPath = Server.MapPath("data.mdb") conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath SET rs = Server.CreateObject("ADODB.Recordset") Rs.Open "Select * From counters" , conn,1,3 IF CSTR(Month(RS("DATE"))) <> CSTR(Month(DATE())) THEN RS("DATE") = DATE() RS("YESTERDAY") = RS("TODAY") RS("BMONTH") = RS("MONTH") RS("MONTH") = 0 RS("TODAY") = 0 RS.Update ELSE IF CSTR(Day(RS("DATE"))) <> CSTR(Day(DATE())) THEN RS("DATE") = DATE() RS("YESTERDAY") = RS("TODAY") RS("TODAY") = 0 RS.Update END IF END IF RS("TOTAL") = RS("TOTAL") + 1 RS("TODAY") = RS("TODAY") + 1 RS("MONTH") = RS("MONTH") + 1 RS.Update response.write "今日浏览总人数:" response.write RS("TODAY") response.write "
" response.write "本站浏览总人数:" response.write RS("TOTAL") response.write "
" N = Now D2 = DateValue(N) D1 = #11/01/2005# ' 开始统计日期(月/日/年) response.write "开站至今的天数:" response.write DateDiff("d", D1, D2) response.write "
" CONN.CLOSE Function numshow( counter ) Dim S, i, G S = CStr( counter ) For i = 1 to Len(S) G = G & "" Next response.write G End Function %>