runtime crash in Release mode but working in Debug mode

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Naved Lodi

    #1

    runtime crash in Release mode but working in Debug mode

    Hi,

    I am facing an issue with release mode.My code is working fine in debug mode.

    The problem is quite strange i am having following code.

    while((bRet == DbNextRow(curso r)) != SQL_NO_DATA)
    {
    }

    in release mode when first time control is getting into DbNextRow(curso r)its is working fine but in next iteration of while loop my cursor(i.e. void* memory address) is comming as 0x0000005 which is not the one which i passed in dbnextrow(curso r). I dont know why it is getting changed when control is going inside the function.

    Could some one help me on this?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    MNaybe you could expose a little more code around this snippet.

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      Are sure you want == between bRet and dbNextRow?

      As it stands now, bRet is compared to dbNextRow(). The result is 0 or 1 depending on whether they differ or match, respectively. You stay in the loop until SQL_NO_DATA matches that 0 or 1 value.

      Comment

      Working...