COM Callable Wrapper!!! :(

tommy.hanks

New member
Joined
Jun 28, 2007
Messages
2
Programming Experience
1-3
Hello everyone! This is my first post, I hope to make it a good one.

I'm writing a class library that needs to be called from both ASP.Net based as well as ASP 3.0 (Classic) based web applications. I've read a few articles about created a COM Callable Wrapper, it's not rocket science. So I write the class library, and test it with a simple VB.NET application that calls the class, and it works just dandy. Next I registered the class using the REGASM tool and wrote a quick WSH VBScript that has the same exact functionality as the VB.NET application. It also works just fine. The problem arises when I try to call the class using ASP 3.0 (Classic). It just doesn't work! I get the following error message:

System.Data (0x80070057)
No mapping exists from object type System.__ComObject to a known managed provider native type.


I'll be more than happy to post my code if asked, but really I just want to know what the heck that error means. Also if someone could shed some light on why the class works with WSH but not ASP that would be dandy as well.

Thanks!

Tom
 
It sounds like, somewhere in your code, you are attempting to use the com object itself when you should be using a property of it. Suppose I make a com object to represnt a person then try to insert his name into a database using a parameterized query:

sqlCommand.Parameters.Add("@Name", myPersonCOMObject)

I should be using:

sqlCommand.Parameters.Add("@Name", myPersonCOMObject.FirstName)



Maybe you set a default property that VB.NET and WSH understand, but ASP3 doesnt.. Look at every place that you use your com object and see if you accidentally make a default-property assumption?

Always be as specific as possible when programming. Option Strict On. Option Explicit On! :)
 
Back
Top