PRB: T-SQL - Running Remote and Local SQL Debugging

Last reviewed: August 5, 1997
Article ID: Q172099
The information in this article applies to:
  • Microsoft Visual Basic Enterprise Edition for Windows, version 5.0
  • Microsoft Visual Studio 97

SYMPTOMS

After installing both SQL Server and Visual Basic 5.0 Enterprise Edition on your local machine, you will be able to perform local SQL debugging. When running the local SQL debugger after remote debugging (Visual Basic and SQL Server reside on two different computers), the T-SQL debugger starts to skip breakpoints set in the SQL stored procedure with the following error message:

   "The query could not be debugged due to a problem coordinating events
   with the server. Check the server and client log to find the exact
   cause, fix the problem and try again."

The Event Viewer log on the server reveals the following error message:

   "CreateDispatch failed (Class not registered). Check to make sure
   Automation manager is running on debugger machine."

CAUSE

When installing the T-SQL Debugger client-side component, Visual Basic will create several Registry keys for VBSDISERVR.SDIEVENT under HKEY_CLASSES_ROOT in the Registry. The \LocalServer32 key for VBSDISERVR.SDIEVENT's CLSID is one of them that is being used by the local SQL debugging. When doing remote debugging from another computer, this key is deleted and some other keys for inprocServer are created. If you do local SQL Debugging after a remote SQL debugging session has been performed, Automation Manager will not be able to find the \LocalServer32 key in the Registry, resulting in the above error.

RESOLUTION

You can add the LocalServer32 key manually in REGEDT32.EXE to enable the next local SQL debugging. However, this key will be deleted again after another remote SQL debugging.

Steps to Add the LocalServer32 Key:

  1. Start the Registry Editor by running regedt32.exe.

  2. In Registry Editor, select HKEY_CLASSES_ROOTS\CLSID\{124765AA-7866-11CF-BF3B-00A0D10003FA}\.

  3. Choose Edit\AddKey on the menu and type "LocalServer32" as Key Name.

  4. Add the following value for LocalServer32 by choosing Edit\AddValue from the menu:

          Value Name:                     (Leave it empty)
          Data Type: REG_SZ
          String: C:\Program Files\DevStudio\VB\Tsql\vbsdicli.exe
    
       Note: Make sure you have an appropriate path for your vbsdicli.exe.
    
    
You can also add this Registry key in Visual Basic code by calling the Registry API. Please refer to the following article in the Microsoft Knowledge Base for how to implement this:

   ARTICLE-ID: Q145679
   TITLE: HOWTO: Use the Registry API to Save and Retrieve Setting

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

This problem only occurs with local debugging. It doesn't happen during remote debugging.

Keywords          : vb5all
Version           : 5.0 97
Platform          : NT WINDOWS
Issue type        : kbprb
Solution Type     : kbworkaround


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.