+ Reply to Thread
Results 1 to 5 of 5

intermittent failure of SQL string

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    intermittent failure of SQL string

    The following code is used to get data from SageLine50:1
    Please Login or Register  to view this content.
    80% of tries brings down the required data but on about 20% the data field remains empty. I have attached the full application in case that would help, but as you will not have access to
    the database perhaps not.

    The application has an Auto_Open procedure which hides the worksheets and makes the userform which contains most of the action, visible.
    As this is an intermittent fault I think it is unlikely that I will be lucky enough to receive a fully finished answer. What I am hoping for are some pointers as to how I can proceed to debug the program
    John
    Attached Files Attached Files

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: intermittent failure of SQL string

    First thing I will say is don't ever just put On Error Resume Next at the top of a routine and hope for the best. It doesn't really handle anything - all it does is prevent you knowing where things went wrong.
    Rory

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: intermittent failure of SQL string

    Try delete the string in red.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Re: intermittent failure of SQL string

    Rorya
    All I can say in my defence is that the On Error Resume Next was put there to catch the situation where one or both ranges were empty. This is a bit unlikely in the app when working properly but was happening a lot during this problem.
    jindon
    I will try your suggestion but the line as in my code came directly from the SQL string generated by MSQuery. I'll let you know how I get on
    John

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: intermittent failure of SQL string

    Quote Originally Posted by j_Southern View Post
    Rorya
    All I can say in my defence is that the On Error Resume Next was put there to catch the situation where one or both ranges were empty. This is a bit unlikely in the app when working properly but was happening a lot during this problem.
    That's not really a reason to leave it in effect for the entire procedure. Error handling should cover the smallest scope required.

    Also, remember that OERN doesn't actually handle anything - it just says "don't tell me if there's a problem, just ignore it and carry on"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Intermittent values for -1 to +1
    By Sekars in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-29-2016, 01:38 AM
  2. VLookup intermittent problem!
    By jpruffle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-08-2008, 03:02 PM
  3. Intermittent problem with Macro
    By scottymelloty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2007, 02:21 PM
  4. [SOLVED] Intermittent Formula Issue
    By Greg in forum Excel General
    Replies: 1
    Last Post: 04-25-2006, 10:50 AM
  5. How to graph intermittent data?
    By jmsmith5 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-11-2005, 06:05 PM
  6. Intermittent issue
    By PeterG in forum Excel General
    Replies: 1
    Last Post: 05-26-2005, 11:01 AM
  7. Conditional Formatting Intermittent at best
    By Yogi_Bear_79 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-16-2005, 11:06 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1