Is it possible to create ASP COM Objects in

Hi there, I'm sure this is probably a stupid question, but for various reasons, I need to access a VB.NET object from within a standard ASP page. Is it possible to even do this and can anyone point me in the right direction of how to do it?

I have so far created a VB.NET class as follows:

Public Class LeapYear2

    Public Function GetDate() As Date
        ' Return today's date
        Return Today
    End Function

End Class

I then created a DLL which i registered using REGASM which seemed to work. I then created an ASP page with the following line in it:

Set oCheckYear = CreateObject("comtest3.LeapYear2")

However, when I run it I get the following error:

Error Type:
/comtest.asp, line 8

Any ideas - I feel like I'm banging my head against a wall at the moment!

Who is Participating?
Timbo87Connect With a Mentor Commented:
You need a create a COM callable wrapper (CCW) for your .NET component in order to use it with ASP, VB6, etc.

The first part of this article explains how to do it:

Here's another article that deals with ASP specifically:
cobrajohn123Author Commented:
Those articles are brilliant, but I still can't make it work... I now get the ASP error:

Server Object, ASP 0177 (0x800401F3)
Invalid class string
/comtest.asp line3

I guess the ASP page cannot see the .NET / COM component I have created, even though I followed every line of the articles you suggested... any more ideas?

cobrajohn123Author Commented:
Hiya - sorted it now - it seems that the example listed is lightly wrong in that the name of the component is wrong...

anyway - it works now - thanks for the pointer...

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.