ASP Access实现网站计数器(访问量)
时间:2019-09-17 13:21 来源/作者:asp教程网
-
<%
-
set conn=server.createobject("adodb.connection")
-
connstr="Provider=Microsoft.jet.oledb.4.0;data source="&server.mappath("cou.mdb")
-
conn.open connstr
-
if session("visited")<>"yes" then
-
application.Lock()
-
conn.execute("update counter set hits=hits+1 where kid=1")
-
application.UnLock()
-
session("visited")="yes"
-
end if
-
set rs=conn.execute("select * from kuo where kid=1")
-
if rs.eof and rs.bof then
-
counters=0
-
else
-
counters=rs("hits")
-
end if
-
rs.close
-
conn.close
-
set rs=nothing
-
set conn=nothing
-
%>
相关文章
热门资讯