Microsoft KB Archive/265492

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

Article ID: 265492

Article Last Modified on 5/28/2003

-

APPLIES TO

 Microsoft COM+ 1.0, when used with:  Microsoft Windows 2000 Standard Edition

 Microsoft Windows XP Professional  Microsoft COM+ 1.5, when used with:  Microsoft Windows 2000 Standard Edition

 Microsoft Windows XP Professional</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q265492

<div class="symptoms_section">

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

<div class="resolution_section">

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.</li> Visual Basic 6 Service Pack 3 (SP3) or later is installed on the computer.</li> 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 PRB: Error Occurs When You Debug a COM+ Component Under the Visual Basic IDE with an ASP Client

</li> The component is deployed in a COM+ application.</li></ul>

<div class="status_section">

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

<div class="moreinformation_section">

Steps to Reproduce the Behavior
<ol> Create a Visual Basic ActiveX DLL project.</li>  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(&quot;Application&quot;) TestFunc = app(&quot;sConn&quot;) End Function

</li>  Create a simple ASP page that calls this component, as follows: <%    Dim str, oComponent Application(&quot;sConn&quot;) = &quot;Test&quot; Set oComponent = Server.CreateObject(&quot;TestObjCntxt.TestClass&quot;) str = oComponent.TestFunc Response.Write(str) %>                    </li> Start the debugger in Visual Basic for the ActiveX DLL project.</li> Locate the ASP page that you created in step 4. You receive the above-mentioned error message.</li></ol>

<div class="references_section">