PRB: ASP 800a005b Object Variable or With Block Variable Not Set

ID: Q243772


The information in this article applies to:
  • Microsoft Transaction Server 2.0
  • Active Server Pages, included with:
    • Microsoft Internet Information Server version 4.0


SYMPTOMS

When calling a Component Object Model (COM) component that uses the ObjectContext function from an Active Server Pages (ASP) page, the following error may occur:

ObjectCtxtProject error '800a005b'
Object variable or With block variable not set
xxx.asp, line xx


CAUSE

In order to obtain the ObjectContext function, the component needs to be running inside a Microsoft Transaction Server (MTS) package.


RESOLUTION

You must register your component within a MTS package. For additional information on how to do this, click the article number below to view the article in the Microsoft Knowledge Base:

Q223406 HOWTO: Create an Empty MTS Package to Add Components for ASP


MORE INFORMATION

Steps to Reproduce Behavior


  1. Stop and start the Web server to unload all DLLs.


  2. Register your Visual Basic ActiveX component from a command prompt as follows:
    regsvr32 yourdll.dll 


  3. Request the ASP page from a browser. This creates the object instance and calls at least one method on it.


  4. The following error is returned:
    ObjectCtxtProject error '800a005b'
    Object variable or With block variable not set
    xxx.asp, line xx


  5. Stop and start the Web server to unload all DLLs.


  6. Create a new MTS Package in the Internet Service Manager and add your component.


  7. Request the ASP page from a browser. The behavior is as expected.



REFERENCES

For additional informations, click the article number below to view the article in the Microsoft Knowledge Base:

Q223406 HOWTO: Create an Empty MTS Package to Add Components for ASP
Q238274 HOWTO: Obtain ObjectContext with ObjectControl Inside VB COM DLL from ASP and MTS

Additional query words:

Keywords : kberrmsg kbASP kbCOMt kbMTS kbGrpASP
Version : winnt:2.0,4.0
Platform : winnt
Issue type : kbprb


Last Reviewed: October 26, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.