Discussion Locked

Counters Component (ASP)

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Could someone please let me know how to create an instance of the Counters Component in an .asp page, not in the global.asa file.(I know you are suppose to only create this object once in the glabal.asa file but is there another way?) I have tried this so far and have come out with an error that says "invalid class string". Here is the code i used:

<%
SET MyCount=Server.CreateObject( "MSWC.Counters" )
%>

Any suggestions? Any help is appriciated and thanks in advance!

Kyle

4 replies

by pramesh

What you had written is correct. Please check for the following files
Counters.dll
Counters.txt
For page scope
<%
set cunt=Server.SET MyCount=Server.CreateObject("MSWC.Counters")
%>
For application scope you can use the follwing code as well as the above code

by ke4vtw

Make certain the DLL containing MSWC.Counters is registered. It seems thta the createobject is not successfully creating the object due to a registration problem.

Use the REGSVR32 application to register the DLL. It's located in the WINNT\SYSTEM32 folder. Just run it and pass the DLL filename as a parameter like this:

REGSVR32 [Drive:][\Path\]DLLNAME.EXT

This discussion is closed to new replies.