Microsoft KB Archive/244457

= How To Debug an MTS Visual Basic Component Running Under ASP =

Article ID: 244457

Article Last Modified on 7/15/2004

-

APPLIES TO


 * Microsoft Active Server Pages 4.0
 * Microsoft Transaction Services 2.0
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q244457



SUMMARY
This article describes how to debug a Visual Basic component registered with Microsoft Transaction Server (MTS) from within the Visual Basic IDE, when created and called from an Active Server Pages (ASP) page.



Prerequisites

 * Requires Visual Basic 6.0 or later.
 * Requires Windows NT 4.0 Service Pack 4 (SP4) or later. MTS debugging is not supported under Windows 95 or Windows 98.
 * The Visual Basic Class that you are debugging should have its MTSTransactionMode property set to anything other than 0 - NotAnMTSObject.
 * Must compile (build the DLL) and set binary compatibility on the project.

Step-By-Step Procedures
 Open a new Visual Basic ActiveX DLL project. Rename Project Name to prjMTSDebug and Class1 to clsMTSDebug  Add the following code to clsMTSDebug: Public Function Sum( Val1 As Integer, Val2 As Integer) As Integer Sum = Val1 + Val2 End Function  Compile the DLL. Set the binary compatibility for the project. Press F5 to run the project. Accept the default settings, and click OK.  Create and add this ASP to one of your virtual directories. <%      Dim Obj Set Obj = Server.CreateObject("prjMTSDebug.clsMTSDebug") Response.Write Obj.Sum(2,3) Set Obj = Nothing %>                   </li> Put a breakpoint in Sum function (in Visual Basic IDE).</li> Run the ASP page from a browser. It breaks at the breakpoint.</li></ol>