Solved

Extremely long runtime for Access query, suppressing error msgs

Posted on 2012-03-13
3
365 Views
Last Modified: 2012-03-28
Hi, Experts -
We are experiencing very long run-times with a query that ties up nearly all of our PC's resources so that we can't do anything else but wait until this Access make-table query finishes.  This usually is 6-7 hours later...!  What's worse, whoever kicks off the execution must respond to error messages issued periodically over the duration of the run.  AUGH!

The query is using ODBC connectivity to link to Oracle databases that are part of an old JDEdwards ERP system.  There are approximately 7 million rows in the database and for each row, the query must:
Rename the 112 columns that it extracts,
Reformat any date fields found using a couple of custom-built functions,
Then write the row out to a new table.
PLUS...as it is doing its thing on each row, there are occassional "Type Mismatch" errors that issue a pop-up box message - to which we click the "END" button and the query continues on its merry way.

We will be migrating the execution of this job onto a server (waiting for the server to be configured with the ODBC connectivity to the JDEdwards system) - but we want to suppress all messages - even the error messages - and just let the query run to completion and create the table.  We currently have the query tied to the click of a button, with the code behind as follows:
Private Sub btn_F4801T_Click()

On Error GoTo Err_btn_F4801T_Click

DoCmd.SetWarnings False

    Dim strQryName As String
    strQryName = "Dump Work Order Master Tag Table - Table Build"
    DoCmd.OpenQuery strQryName, acNormal, acEdit

DoCmd.SetWarnings True

Exit_btn_F4801T_Click:
    Exit Sub

Err_btn_F4801T_Click:
    MsgBox Err.Description
    Resume Exit_btn_F4801T_Click
    
End Sub

Open in new window


QUESTIONS:  How can we suppress ALL messages and how can we get this query to run more quickly?
0
Comment
Question by:OGSan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 57
ID: 37717725
<<QUESTIONS:  How can we suppress ALL messages and how can we get this query to run more quickly?>>

<<What's worse, whoever kicks off the execution must respond to error messages issued periodically over the duration of the run.  AUGH!>>

  Not to be flippant, but fix the code!  Type mis-match is the result of a coding error.

  Beyond that in regards to performance, someone would need to go through what your doing in detail to help speed it up.

Jim.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37718050
Yes, "long runtime" can be caused by many things.
Depending on what you are doing, it may never be what you might call "Fast"

In other words, what you are asking it to do, may very well take 6-7 hours...

As jim stated, you need to take a long hard look at your coding.
many parts of it may be inefficient:

Poorly declared variables, using recordsets where SQL might be a better choice, inefficient looping code, poor indexing strategy, to many concurrent users, un-Split configuration, complex AND/OR Logic, Multiple wildcards, the DB not being compacted, code not being compiled, ...etc

Not to mention network issues, or hardware deficiencies...

Again, far to many possibilities to take a wild guess here...

Note that all of the things that you say are happening here would (to me) seem to indicate that there is more than just *one query* involved here...

See these links as a starting point:
http://office.microsoft.com/en-us/access-help/improve-performance-of-an-access-database-HP005187453.aspx
http://www.granite.ab.ca/access/performancefaq.htm
http://www.fmsinc.com/MicrosoftAccess/Performance.html

<How can we suppress ALL messages >
Type mismatch is an *error*, not simply a message.
So here your goal would be to avoid the error in the first place, not simply "suppress" it...

You may be able to catch the error in an error handler though...
Jim could help you with this...

Jeffcoachman
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 37719179
You might also consider doing a lot (or all) of this on the Server first, and then just moving the data over to Access (or just linking the new table to Access). Oracle can do a much better and faster job of these things in most cases.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question