Article ID: 265492 - Last Review: May 28, 2003 - Revision: 2.2

BUG: ObjectContext Item Collection Is Empty When You Debug Under COM+

This article was previously published under Q265492

On This Page

Expand all | Collapse all

SYMPTOMS

With Microsoft Visual Basic 6.0 Service Pack 2 (SP2) installed on your computer, if you create a Visual Basic ActiveX dynamic-link library (DLL) that is in a COM+ program and you try to debug it, when it is being accessed from an Active Server Pages (ASP) page, the following error message may occur:
Run-Time error '424':
Object Required

RESOLUTION

To debug a Visual Basic ActiveX DLL that is in a COM+ application, you must ensure that the following are true:
  • The MTS Transaction Mode for the component is set to a value other than 0 - NotAnMTSObject.
  • Visual Basic 6 Service Pack 3 (SP3) or later is installed on the computer.
  • The authenticating user has the appropriate permissions. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
    259725  (http://support.microsoft.com/kb/259725/EN-US/ ) PRB: Error Occurs When You Debug a COM+ Component Under the Visual Basic IDE with an ASP Client
  • The component is deployed in a COM+ application.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Create a Visual Basic ActiveX DLL project.
  2. Add a simple function to the project that returns a string, as follows:
    Public Function TestFunc() As Variant
        
        Dim ctx As COMSVCSLib.ObjectContext
        Dim app As ASPTypeLibrary.Application
          
        Set ctx = GetObjectContext()
        'Breaks here ,app is nothing
        Set app = ctx("Application")
        TestFunc = app("sConn")
       
    End Function
    
    					
  3. Create a simple ASP page that calls this component, as follows:
    <% 
        Dim str, oComponent 
        Application("sConn") = "Test"
        Set oComponent = Server.CreateObject("TestObjCntxt.TestClass") 
        str = oComponent.TestFunc() 
        Response.Write(str) 
    %> 
    					
  4. Start the debugger in Visual Basic for the ActiveX DLL project.
  5. Locate the ASP page that you created in step 4. You receive the above-mentioned error message.

REFERENCES

Visual Studio service packs and product updates can be found at the following MSDN Web site:
http://msdn.microsoft.com/downloads/ (http://msdn.microsoft.com/downloads/)

APPLIES TO
  • Microsoft COM+ 1.0, when used with:
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows XP
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows XP
Keywords: 
kbbug kberrmsg kbfix KB265492
 

Article Translations