Hi I have this problem.
I added counter to my home page to count visits it was working normally but when i get more traffic i face some error there assume i have the visit counter shows 700 visit when the error appear it changes the visit counter to 0 and start from there please could any body help m with this.
here is the code i am using
to read old value
VB Code:
accessdb = server.mappath("any.mdb") strconn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" strconn = strconn & accessDB & ";" Set conn = Server.CreateObject("ADODB.Connection") conn.open strconn strsql = "SELECT * FROM table where id=" & id Set rs = conn.execute(strsql) hits=rs("hits") rs.close set rs = nothing conn.close Set conn = nothing hits=hits+1
update with new value
VB Code:
accessdb = server.mappath("any.mdb") strconn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" strconn = strconn & accessDB & ";" Set conn = Server.CreateObject("ADODB.Connection") conn.open strconn conn.execute("update table set [hits]=" & hits & " where [id]=" & id) conn.close Set conn = nothing
Thanks




Reply With Quote