It allows to count the visits using the session. Memorizes accesses in a text file.
<%
dim myweb
dim lun
dim referer
myweb="http://www.myweb.com"
lun=len(myweb)
referer=request.servervariables("HTTP_REFERER")
Set Fil=CreateObject("Scripting.FileSystemObject")
Set inf=Fil.OpenTextFile(Server.MapPath("counter.txt"),1,true)
text=inf.ReadLine()
inf.Close
Set inf=Nothing
if session("visited")<>"si" and left(referer,lun)<>left(myweb,lun) then text=text+1
session("visited")="si"
end if
Set out=Fil.CreateTextFile(Server.MapPath("counter.txt"),true)
out.WriteLine(text)
out.Close
Set out=Nothing
Set Fil=Nothing
response.write "Visit number:" & text
%>
where counter.txt is a text file in the site root.