?
Solved

Is it possible to create ASP COM Objects in vb.net?

Posted on 2004-08-29
3
Medium Priority
?
627 Views
Last Modified: 2007-12-19
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:
(0x80070002)
/comtest.asp, line 8

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

John.
0
Comment
Question by:cobrajohn123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 600 total points
ID: 11927022
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:
http://www.c-sharpcorner.com/articles/accessingdotnetfromcom.asp

Here's another article that deals with ASP specifically:
http://www.dnzone.com/ShowDetail.asp?NewsId=126
0
 

Author Comment

by:cobrajohn123
ID: 11929725
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?

John.
0
 

Author Comment

by:cobrajohn123
ID: 11930137
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...

John.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question