Link to home
Start Free TrialLog in
Avatar of ToddRod_Taylor
ToddRod_TaylorFlag for United States of America

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.

ASKER CERTIFIED SOLUTION
Avatar of kathik
kathik
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ToddRod_Taylor

ASKER

After a procedure with ON ERROR RESUME NEXT set finishes, does that go back to a default ?
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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!
Thanls for the points and glad to be of help.