HOWTO: Debug an MTS Visual Basic Component Running Under ASP

ID: Q244457


The information in this article applies to:
  • Microsoft Windows NT, versions 4.0 SP4, 5.0
  • Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 6.0
  • Active Server Pages


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.


MORE INFORMATION

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.


  • Make sure the component to be debugged is not registered with MTS (delete and reinstall the package after debugging).


Step-By-Step Procedures

  1. Open a new Visual Basic ActiveX DLL project.


  2. Rename Project Name to prjMTSDebug and Class1 to clsMTSDebug


  3. Add the following code to clsMTSDebug:


  4. 
    Public Function Sum( Val1 As Integer, Val2 As Integer) As Integer
    	Sum = Val1 + Val2
    End Function 
  5. Compile the DLL.


  6. Set the binary compatibility for the project.


  7. Press F5 to run the project. Accept the default settings, and click OK.


  8. Create and add this ASP to one of your virtual directories.


  9. 
    <%
           Dim Obj
           Set Obj = Server.CreateObject("prjMTSDebug.clsMTSDebug")
           Response.Write Obj.Sum(2,3)
           Set Obj = Nothing
    %> 
  10. Put a breakpoint in Sum function (in Visual Basic IDE).


  11. Run the ASP page from a browser. It breaks at the breakpoint.


Notes

  • Do not deploy an MTS component when you are in a debug session.


  • The MTS component that you debug runs as a library package, which doesn't support component tracking, role checking, or process isolation.


Additional query words:

Keywords : kbCOMt kbDebug kbMTS kbVBp600 kbGrpASP kbDSupport
Version : WINDOWS:6.0; winnt:4.0 SP4,5.0
Platform : WINDOWS winnt
Issue type : kbhowto


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