Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Skipping Some queries and conditions

Skipping Some queries and conditions

Scheduled Pinned Locked Moved Visual Basic
helpdatabasedebuggingperformance
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jishbalan
    wrote on last edited by
    #1

    Hello friends, I am struck with a bug in my code and find it difficult to debug. In my MS access application, I am creating some reports using SQL queries to fetch data from Access Table and SQL table. Some time the code works fine, creating the report fine. Some time its not creating the report fully, skipping some queries and conditions. If I try to run the code using 'Step in', the report always creating as expected. if it run otherwise report fails. I tried using with delays, then its working fine. But I have to use min 5 sec delay for that. So its effecting the performance. I dont have much experience in VBA and SQL queries. IS it due to some error in my code or something else? Thanks and regards Jishith

    D 1 Reply Last reply
    0
    • J jishbalan

      Hello friends, I am struck with a bug in my code and find it difficult to debug. In my MS access application, I am creating some reports using SQL queries to fetch data from Access Table and SQL table. Some time the code works fine, creating the report fine. Some time its not creating the report fully, skipping some queries and conditions. If I try to run the code using 'Step in', the report always creating as expected. if it run otherwise report fails. I tried using with delays, then its working fine. But I have to use min 5 sec delay for that. So its effecting the performance. I dont have much experience in VBA and SQL queries. IS it due to some error in my code or something else? Thanks and regards Jishith

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Without seeing the code, it's impossible to say. Even then, with it may be difficult. If sections of code are being skipped, it sounds like you have a design problem or you're catching and eating errors with On Error Resumt Next, without checking the Err object at various stages to see if an error occured before continuing.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      J 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Without seeing the code, it's impossible to say. Even then, with it may be difficult. If sections of code are being skipped, it sounds like you have a design problem or you're catching and eating errors with On Error Resumt Next, without checking the Err object at various stages to see if an error occured before continuing.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        J Offline
        J Offline
        jishbalan
        wrote on last edited by
        #3

        The code works always fine with single steppings. When at full running , the problem occurs.. If i putting any break point inside the code, 80% times run properly... And i am not using On Error Resume Next in this function.

        D 1 Reply Last reply
        0
        • J jishbalan

          The code works always fine with single steppings. When at full running , the problem occurs.. If i putting any break point inside the code, 80% times run properly... And i am not using On Error Resume Next in this function.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Then you're going to have to put some tracing code in there to see what variables have what values at various points in your code. Log this information to a file and review it when the problem occurs.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups