473,249 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,249 software developers and data experts.

error '80131509'

I created a .NET assembly and made it accessable as a COM object. When I
tried to instantiate it in an ASP page, I got error '80131509'. If I create
the COM object in a simple HTML page it works fine. I am using ASP, not
ASP.NET. Searching for the number on google gives no help whatsoever.

This is the ASP that I am using:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession = CreateObject("ComTest.WebFarmSession")
%>
Jul 21 '05 #1
4 12905
How are you "creating the COM object in a simple HTML page"? Is it a
control that the user will see? Otherwise, what purpose could it serve in
HTML?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Jason Rowland" <Ja**********@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
I created a .NET assembly and made it accessable as a COM object. When I
tried to instantiate it in an ASP page, I got error '80131509'. If I create the COM object in a simple HTML page it works fine. I am using ASP, not
ASP.NET. Searching for the number on google gives no help whatsoever.

This is the ASP that I am using:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession = CreateObject("ComTest.WebFarmSession") %>

Jul 21 '05 #2
How are you "creating the COM object in a simple HTML page"? Is it a
control that the user will see? Otherwise, what purpose could it serve in
HTML?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Jason Rowland" <Ja**********@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
I created a .NET assembly and made it accessable as a COM object. When I
tried to instantiate it in an ASP page, I got error '80131509'. If I create the COM object in a simple HTML page it works fine. I am using ASP, not
ASP.NET. Searching for the number on google gives no help whatsoever.

This is the ASP that I am using:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession = CreateObject("ComTest.WebFarmSession") %>

Jul 21 '05 #3
I am creating it on the HTML page just to test that my .NET COM object was
working properly (it was).
dim myobj
set myobj = CreateObject("ComTest.WebFarmSession")
myobj.testmethod()

When I moved the code to an ASP page to use it server side where it will be
used, I got the error. The error message "error 80131509" that is returned
is extremely unhelpful. The problem is I don't know ASP as all my experience
is .NET, java. Instead of the code that worked for me in the html file, I
needed to use:

set WebFarmSession = Server.CreateObject("ComTest.WebFarmSession")

If you omit the "Server." prefix, you get that error.

"Aaron [SQL Server MVP]" wrote:
How are you "creating the COM object in a simple HTML page"? Is it a
control that the user will see? Otherwise, what purpose could it serve in
HTML?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Jason Rowland" <Ja**********@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
I created a .NET assembly and made it accessable as a COM object. When I
tried to instantiate it in an ASP page, I got error '80131509'. If I

create
the COM object in a simple HTML page it works fine. I am using ASP, not
ASP.NET. Searching for the number on google gives no help whatsoever.

This is the ASP that I am using:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession =

CreateObject("ComTest.WebFarmSession")
%>


Jul 21 '05 #4

Jason Rowland wrote:
[b]I created a .NET assembly and made it accessable as a COM object.
When I
tried to instantiate it in an ASP page, I got error '80131509'.


This reply is being posted (two years too late) because I ran into the
80131509 problem and this post is the most frequently presented by
Google in response to this error number. However the thread doesn't
(didn't) contain an answer. Having spent two hours cracking the
problems, others might save a bit of time knowing an answer.

Like Jason I have a .NET (C# as it turns out) assembly that exposes a
class as a COM object. When used from an Excel add-in (written in VB)
the class works. But if the COM class exposed by the assembly is
instantiated from a .vbs script or even a VB program an 80131509 error
is raised. When I put message boxes in the class constructor I could
see that the constructor runs successfully but that the error is raised
after - so reason suggests that it was not a code problem.

After stripping out ALL the code, the only slightly unusual thing left
was that the exposed class inherits from a base class. Because I don't
want the base class exposed to COM it was decorated with
[ComVisible(false)]. When I finally removed this decoration from the
base class the COM class worked in VB and in scripts.

So it seems mscorlib does not want to expose a .NET class to COM if
it's base class is not visible. My lesson is that classes which are to
be exposed should not inherit. They should single classes that delegate
to a contained instance of the class that really does the work.

--
bseddon
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jun 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
5
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
5
by: yashu0209 | last post by:
I have an error occurring when i try to compile the program and the error is: D:\Program Files\visual studio 6.0\MSDev98\MyProjects\GLEnabledView\GLNew.cpp(164) : error C2653: 'CGLEnabledView' :...
2
by: randa zaghdan | last post by:
Hi I have a problem with my program in vc 2008 When I compile it, the following errors are listed. I try to resolve it but no hope Does any one can help me ? thanks . Linking......
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.