<% set conn=server.createobject("adodb.connection") connstr="Provider=Microsoft.jet.oledb.4.0;data source="&server.mappath("cou.mdb") //cou是数据库名 conn.open connstr if session("visited")<>"yes" then application.Lock() conn.execute("update counter set hits=hits+1 where kid=1") //counter是数据库里面用于存储数据的表名 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 %>
推荐阅读
分页实现方法的性能比较
几种常用存储过程分页方法 TopN方法 select Top(@PageSize) from TableName where ID Not IN (Select Top ((@PageIndex-1)*@PageSize) ID from Table Name where .... order by ... ) where .... order by ... 临时>>>详细阅读
本文标题:ASP Access实现网站计数器(访问量)
地址:http://www.17bianji.com/kaifa2/ASP/32126.html
1/2 1