Results 1 to 5 of 5

Thread: Vanishing Bug

  1. #1

    Thread Starter
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    35,243

    Vanishing Bug

    Had a terrific bug to post here.....then it just went away.

    I had created a command object from a connection, and passed it ByRef to two different functions one after the other. I had an unrelated issue in the second function, so I set a breakpoint just before I set the commandText property of the command object. Much to my amazement, when I stepped through the line that assigned a SQL statement to the CommandText property, the property simply didn't change!! That meant that it had the wrong SQL statement, returned the wrong recordset in a DataReader, and promptly crashed the function, which was expecting a reader with different fields from a different table.

    I played around with this for half an hour or more until I was convinced that I had found an EXCELLENT IDE bug. If I had no breakpoint, the code executed correctly. If I had a breakpoint sufficiently downstream of the point where the CommandText was set, the program worked correctly. If I set a breakpoint either at the line where the CommandText was set, or any place prior to that, the text wouldn't change.

    I went back to look at the same thing the next day, and the whole thing had gone away. I couldn't reproduce the behavior that I had studied so carefully only the day before. Bummer!

    Any comments?
    My usual boring signature: Nothing

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,470

    Re: Vanishing Bug

    Quote Originally Posted by Shaggy Hiker
    Any comments?
    Did you kick a serious drug habit at any stage between those two days of testing?

  3. #3

    Thread Starter
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    35,243

    Re: Vanishing Bug



    I'm STILL laughing over that reply. Most EXCELLENT!

    I sure did feel like I had headed right down the rabbit hole when the whole thing just went away on its own.
    My usual boring signature: Nothing

  4. #4
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: Vanishing Bug

    I've sometimes had similar problems in reverse - code working when stepped through but not without the breakpoint. Makes debugging somewhat difficult. And most of the time the problem has seemed to resolve itself of its own accord.


    Grr.
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  5. #5
    New Member DM/Diddy's Avatar
    Join Date
    Apr 2006
    Posts
    1

    Re: Vanishing Bug

    I had a similar problem in Excel with code in a userform that would run when stepped through, but would intermittantly crash otherwise. In fact, if the VB IDE window was open, it would work! We paid Microsoft support to help me find the source of the bug. It wound up going all the way to the Excel developers. Nobody had an answer. It chewed up about 100 hours of my time, and I worked with them about 6 months. I tried everything they suggested, totally rebuilt the workbook from scratch, etc. Still crashed.

    I figured it had something to do with the VB code not being compiled at the right time, since the execution pointer was going astray. So my solution was to put some code in the auto_open routine that wrote a change to the code module of the offending userform. Just incremented the value of a bogus constant,thus forcing a compile. Since then it hasn't crashed in over a year and everything is hunky-dory.

    Thanks for NOTHING Microsoft!

    Anyway, here's another breakpoint bug I just got (I've seen this once before): When a user runs some VB code I wrote in Excel, it breaks on the last place I had set a breakpoint while writing the code! Even though the file was closed and emailed to him, Excel still thinks there's a breakpoint there! If he hits continue, it runs fine.

    I can run the exact same file on my PC and it doesn't stop. I've Googled for "invisible breakpoint" and "phantom breakpoint" to no avail.

    Any one seen this before?

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width