Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: Re: 800a01ad, Activex Component Can't Create Object


Message #1 by "Saurabh" <shardasaurabh@y...> on Thu, 3 Oct 2002 14:34:38
> I am calling COM component from an ASP page, and everything worked fine, 
> untill I added a new class to the COM component. Now, when I run the COM 
> component in debug mode, and call this new class from the ASP page, it 
> says, VB Script Runtime Error 800a01ad 'Activex Component Can't Create 
> Object'. But it works absolutely fine, if I make a dll and register it 
on 
> the MTS. Please suggest, how to solve this problem.
Message #2 by Imar Spaanjaars <Imar@S...> on Thu, 03 Oct 2002 15:30:49 +0200
Whenever you add a new method or class to a VB DLL, Visual Basic will 
create a new GUID for the component.

In your ASP page, you write something like 
Server.CreateObject("MyProject.MyClassName") Internally, that's not what 
the ASP runtime uses. It uses the MyProject.MyClassName construct to lookup 
the GUID that belongs to this component. The GUID is stored in the registry 
and contains a reference to the actual DLL.to load

Now, if you recompile, the GUID changes and the reference stored in MTS is 
no longer valid. (This is one of the basic principles of COM(+): If the 
contract changes (that is, new methods, class etc) you can no longer refer 
to the component with the same GUID. )

So, whenever you change classes, methods etc in the VB project, you'll have 
to re-register the component in MTS.

HtH

Imar




At 02:34 PM 10/3/2002 +0000, you wrote:
> > I am calling COM component from an ASP page, and everything worked fine,
> > untill I added a new class to the COM component. Now, when I run the COM
> > component in debug mode, and call this new class from the ASP page, it
> > says, VB Script Runtime Error 800a01ad 'Activex Component Can't Create
> > Object'. But it works absolutely fine, if I make a dll and register it
>on
> > the MTS. Please suggest, how to solve this problem.



  Return to Index