Catastrophic Errors (1 Viewer)

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 07:40
Joined
Sep 12, 2006
Messages
15,658
I just wondered whether anyone builds in error-handling for catastrophic errors such as a Network Service being interrupted, showing as an unusual negative error number. Would that have to added as a form error in every form?

The only comparable error I can imagine with a normally working database is a disk full situation, or maybe an Access database hitting 2Gb. Does anyone allow for that as well?
 

GPGeorge

Grover Park George
Local time
Yesterday, 23:40
Joined
Nov 25, 2004
Messages
1,873
I just wondered whether anyone builds in error-handling for catastrophic errors such as a Network Service being interrupted, showing as an unusual negative error number. Would that have to added as a form error in every form?

The only comparable error I can imagine with a normally working database is a disk full situation, or maybe an Access database hitting 2Gb. Does anyone allow for that as well?
That's an interesting question in a couple of ways.

First, I don't try to anticipate every error imaginable, so the simple answer might be, no.

However, if the environment where a specific application is to be used is prone to problems such as the one you mention, it's probably worth the extra time and effort to implement a protective error handler. I do recall one situation from pre-retirement days where the wiring in an old office was less than reliable. We actually ended up migrating to SQL Azure. It was slower, but more reliable than with accdb back ends, and data was no longer corrupted on a regular basis. Probably not what you meant, but in the same arena of concern.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 07:40
Joined
Sep 12, 2006
Messages
15,658
Thanks @GPGeorge

I guess I'm really thinking of the broad error "Your Network Access Was Interrupted."

Would windows try to connect repeatedly before failing., and generating that error? Can you recover from that? Might closing and reopening the active form help, or do you just have to exit the database and try again?
 

isladogs

MVP / VIP
Local time
Today, 07:40
Joined
Jan 14, 2017
Messages
18,235
I do have code to check whether SQL Server is running when one of my maintenance apps is first loaded.
However, its arguable whether that offers any real advantage over checking that a sample SQL table is connected
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 07:40
Joined
Sep 12, 2006
Messages
15,658
Thanks Colin.

It's actually failing mid-session. It starts OK - I actually check every table, and some mapped network folders at start-up, but the connection (servers on the same LAN) is getting interrupted and failing during the session.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:40
Joined
Feb 28, 2001
Messages
27,191
Here is the problem: You can intercept a whole lot of errors, particularly the ones with negative numbers. But those are usually SYSTEM-intercepted errors, not Access Run-Time errors. If it is a math error, you can probably do something with it, but there are literally thousands of possible errors. And if you are using an application object (Excel, Word, Outlook) then add a few thousand more possibilities.

Further, if it is a "real" fatal error then it is a tossup as to whether you will even get the chance. If the error in hexadecimal starts with 8 (0h8xxxxxxx, i.e. bit 31 is set but not bit 30) then maybe you could handle it. If it starts with C (0hCxxxxxxx, i.e. bits 31 & 30 are set) then step away from the curb. Those are catastrophic Windows errors where options probably would be taken away from you anyway. If you have "rolled your own" errors, then the numbers won't be 0h8 or 0hC but something else, because the next bit in sequence is a "customer-defined" flag.

The errors are encoded to form a 32-bit severity-facility-error combination. The low half of the error is specific to the error. The severity is in the high-order 5 bits. The 11 bits from 16-26 are facility codes - as in Excel, Access, Word, etc. or Windows itself.

The error mapping is described here:


The "low" error numbers for SYSTEM errors are found here:

 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 07:40
Joined
Sep 12, 2006
Messages
15,658
Thanks. @The_Doc_Man

Yes, I am thinking of unusual negative error codes. The low value errors are very interesting though.

I thought if there was a way to trap them anyway, I would just have to create a form_error error handler in every form, and probably just close the database down.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:40
Joined
Feb 28, 2001
Messages
27,191
I thought if there was a way to trap them anyway, I would just have to create a form_error error handler in every form, and probably just close the database down.

IF you are even allowed to see them, you can probably trap them and institute a shutdown. That's a very big IF. But in the 0hCxxxxxxx category, you might not be allowed to even see it. So focus on the other ones first.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 07:40
Joined
Sep 12, 2006
Messages
15,658
I just thought I would provide an update.

It turned out that what happened was that the shared drives were being rechecked every so often by the network policy but were actually being reset (recreated?) rather than just rechecked. If a shared drive to the database was actually in use at the time, the network access was interrupted, and access crashed instantly. The backend was SQL Server, so there was no permanent connection, but occasionally the events clashed.
 

Users who are viewing this thread

Top Bottom