BUG: T-SQL Debugger Does Not Run on NT with User Account

Last reviewed: October 29, 1997
Article ID: Q175868
The information in this article applies to:
  • Microsoft Visual Basic Enterprise Edition for Windows, version 5.0

SYMPTOMS

T-SQL Debugger causes the following error when a stored procedure is called if the Visual Basic 5.0 application is being run on an NT 4.0 machine where the login was to a User Account:

   "You must have Privledges to modify the registry"

NOTE: The word "Privileges" is misspelled in the error message.

Visual Basic will hang when the application is ended and the task manager must be invoked to shut it down.

RESOLUTION

Use an NT login account that has administrator rights.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Login into an NT server with administrator privileges.

  2. Create a stored procedure on Sqlserver 6.5 by running the following code in ISQL/W:

          CREATE PROCEDURE findstate @whichstate char(2) as
          select * from authors where state= @whichstate
    

  3. Create a Visual Basic Project and check "Microsoft Remote Data Object 2.0" under Project References.

  4. Under Add-Ins Manager, check Visual Basic T-SQL Debugger. Under Tools, T_SQL Debugging Option make sure both check boxes are checked. See references mentioned below for setting up T-SQL Debugger.

  5. Place two CommandButtons on the form. Paste the following code in the form:

             Option Explicit
               Dim cn As rdoConnection
               Dim qy As rdoQuery
               Dim rs As rdoResultset
               Dim strConnect As String
               Dim n As Integer
       
             Private Sub Command2_Click()
                rs.Close
                Set rs = Nothing
                unload me
             End Sub
       
         Private Sub Command1_Click()
       
            strConnect = "driver={SQL Server};server=servername;" & _
              "database=pubs;uid=sa;pwd="
            rdoEnvironments(0).CursorDriver = rdUseOdbc
            Set cn = rdoEnvironments(0).OpenConnection( _
              dsName:="", _
              Prompt:=rdDriverNoPrompt, _
              ReadOnly:=False, _
              Connect:=strConnect)
       
            Set qy = cn.CreateQuery("sql", _
                    "{call pubs.dbo.findstate(?) }")
            qy.RowsetSize = 1
            qy.rdoParameters(0) = "CA"
            Set rs = qy.OpenResultset( _
              Type:=rdOpenForwardOnly, _
              LockType:=rdConcurReadOnly)
       
            While Not rs.EOF
              debug.print rs(0) & ", " & rs(1)
              rs.MoveNext
            Wend
       
          End Sub
    
    

  6. Place a break point on the procedure call line.

  7. Run the code and T-SQL debugger should come up.

  8. Press the F5 key and it should continue.

  9. Close Visual Basic and restart NT. Login to User Account.

  10. Open the same project making sure T-SQL debugger is activated.

  11. Run the application and the error will appear.

REFERENCES

Visual Basic Books Online, query on "t-sql debugger," use quotes.

Hitchhiker's Guide to Visual Basic & SQLserver. pp411-413

For more information on T-SQL Debugger for setup problems, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q166280
   TITLE     : T-SQL Debugger Server Setup Provides Incorrect Location
   
   ARTICLE-ID: Q172099
   TITLE     : T-SQL - Running Remote and Local SQL Debugging
Keywords          : vb5all kberrmsg
Version           : WINDOWS:5.0
Platform          : WINDOWS
Issue type        : kbbug


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


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: October 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.