this is about as basic as it gets for a asp counter. you use the global.asa in this "very simple"
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Option Explicit
Sub Application_OnStart
On Error Resume Next
Dim ObjCounter
Dim strCounter
strCounter = "ProjectName"
Application("CounterName"

= strCounter
Set ObjCounter = Server.CreateObject("MSWC.Counters"

If (Err <> 0) Then
Application("IsErr" ) = Err.Number
Else
Call Counters.Set(HitsCounter, 1 )
Set Application("MSCounters"

= ObjCounter
Application("IsErr"

= 0
End If
Err.Clear
End Sub
Sub Application_OnEnd
On Error Resume Next
Application("IsErr"

= Nothing
Application("MSCounters"

= Nothing
End Sub
Sub Session_OnStart
Err = 0
End Sub
Sub Session_OnEnd
Err = 0
End Sub
</SCRIPT>
to write it to the page do
<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
</HEAD>
<BODY>
<h2>Demo of the ASP Counter Component</h2>
<%
On Error Resume Next
Dim ObjCntr
Dim nCount, nErr
Dim strName
strName= Application("CounterName"
Set ObjCntr = Application("MSCounters"
nCount = ObjCntr.Increment(strName)
nErr = Application("IsErr"
If (Err <> 0 AND nErr <>0) then
Response.Write ("<P>Error: Could not get the instance of the Counters Object.<br> Error Code:" + CStr(nErr) )
Else
Response.Write ("<h4><P>There have been" + CStr(nCount) + " visits to this Web page."

End If
%>
</BODY>
</HTML>
![[bomb] [bomb] [bomb]](/data/assets/smilies/bomb.gif)
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com