ASP Access實(shí)現(xiàn)網(wǎng)站計(jì)數(shù)器(訪問(wèn)量)
更新時(shí)間:2008年11月12日 00:30:30 作者:
學(xué)習(xí)asp的朋友需要了解下
<%
set conn=server.createobject("adodb.connection")
connstr="Provider=Microsoft.jet.oledb.4.0;data source="&server.mappath("cou.mdb") //cou是數(shù)據(jù)庫(kù)名
conn.open connstr
if session("visited")<>"yes" then
application.Lock()
conn.execute("update counter set hits=hits+1 where kid=1") //counter是數(shù)據(jù)庫(kù)里面用于存儲(chǔ)數(shù)據(jù)的表名
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
%>
set conn=server.createobject("adodb.connection")
connstr="Provider=Microsoft.jet.oledb.4.0;data source="&server.mappath("cou.mdb") //cou是數(shù)據(jù)庫(kù)名
conn.open connstr
if session("visited")<>"yes" then
application.Lock()
conn.execute("update counter set hits=hits+1 where kid=1") //counter是數(shù)據(jù)庫(kù)里面用于存儲(chǔ)數(shù)據(jù)的表名
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
%>
您可能感興趣的文章:
- 詳解Java多線程編程中CountDownLatch阻塞線程的方法
- Java多線程編程之CountDownLatch同步工具使用實(shí)例
- java線程并發(fā)countdownlatch類使用示例
- Java數(shù)據(jù)結(jié)構(gòu)及算法實(shí)例:快速計(jì)算二進(jìn)制數(shù)中1的個(gè)數(shù)(Fast Bit Counting)
- js計(jì)數(shù)器代碼
- Redis的使用模式之計(jì)數(shù)器模式實(shí)例
- PHP計(jì)數(shù)器的實(shí)現(xiàn)代碼
- php計(jì)數(shù)器的設(shè)計(jì)與實(shí)現(xiàn)
- MySQL中實(shí)現(xiàn)高性能高并發(fā)計(jì)數(shù)器方案(例如文章點(diǎn)擊數(shù))
- Java中CountDownLatch用法解析
相關(guān)文章
Jmail組件發(fā)送郵件之絕對(duì)能用的函數(shù)
Jmail組件的這些對(duì)象為服務(wù)器端對(duì)郵件的操作提供了各種各樣的功能,每個(gè)對(duì)象都有其獨(dú)特應(yīng)用2006-12-12asp利用Split函數(shù)進(jìn)行多關(guān)鍵字檢索
怎樣提取數(shù)據(jù)庫(kù)用|隔開(kāi)的字!2009-09-09asp+JMAIL實(shí)現(xiàn)發(fā)送郵件
這篇文章主要介紹了asp+JMAIL實(shí)現(xiàn)發(fā)送郵件實(shí)例代碼,感興趣的小伙伴們可以參考一下2015-09-09asp中utf8不會(huì)出現(xiàn)亂碼的寫(xiě)法
有時(shí)候我們?cè)赼sp編寫(xiě)中需要聲明好頁(yè)面的編碼否則容易出現(xiàn)亂碼,這里是utf-8格式的2013-08-08asp下輕松實(shí)現(xiàn)將上傳圖片到數(shù)據(jù)庫(kù)的代碼
asp下輕松實(shí)現(xiàn)將上傳圖片到數(shù)據(jù)庫(kù)的代碼...2007-11-11ASP基礎(chǔ)入門(mén)第十篇(ASP內(nèi)建對(duì)象Server)
這篇文章主要介紹了ASP內(nèi)建對(duì)象Server的相關(guān)資料,需要的朋友可以參考下2015-10-10