Solved

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

Posted on 2004-08-29
3
625 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 150 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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