ToddRod_Taylor
asked on
handle ODBC timeout programmatically to continue execution
I have a large program with queries to 80+ different SQL servers over the net.
My problem: how can I programmactically handle timeouts when they occur due to 1 or more of those servers being down; and thus not stop execution with an error box, but continue executing the remainder of the lines in my code; in effect "skipping" the one that timed out?
I simply have 80+ of these:
DoCmd.OpenQuery "1-POS"
DoCmd.OpenQuery "2-POS"
DoCmd.OpenQuery "3-POS"
etc.
My problem: how can I programmactically handle timeouts when they occur due to 1 or more of those servers being down; and thus not stop execution with an error box, but continue executing the remainder of the lines in my code; in effect "skipping" the one that timed out?
I simply have 80+ of these:
DoCmd.OpenQuery "1-POS"
DoCmd.OpenQuery "2-POS"
DoCmd.OpenQuery "3-POS"
etc.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The ON ERROR RESUME NEXT will be local to that procedure. So, if a calling procedure has different error handling, it will take over once this one is finished. I think the default error handling in MS Access is just to break at the error.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
foolish me.....
the ON ERROR RESUME NEXT is perfect ; down-n-dirty
trapping for which one failed I liked as well.
I used the ON ERROR RESUME for a few days, then coded the trap to tell me which servers where down. Both served my needs, thanks!
the ON ERROR RESUME NEXT is perfect ; down-n-dirty
trapping for which one failed I liked as well.
I used the ON ERROR RESUME for a few days, then coded the trap to tell me which servers where down. Both served my needs, thanks!
Thanls for the points and glad to be of help.
ASKER