Hi,
I'm afraid that my answer will not make you happy, but:
-- It is near to impossible to handle runtime errors in VBScript;
-- 'On Error Resume Next' is not recommended to be used by all good coding practices (not just for VBScript, but for VB as well);
-- If you *really* need to handle possible runtime error, then you must remember, that every script code statement upon its execution resets the value of the Err built-in structure. This means that you *must* save the value of the Err.Number property *immediately* after the script line where you expect the runtime error, turn on error handling and only then check if there was an error or not. E.g.:
On Error Resume Next
OpenDBConnection()
iErr = Err
On Error GoTo 0
If (0 <> iErr) Then
...
Note, that if you expect runtime error to be possible in two subsequent script code lines then you must check the error value after each line. This is just because if the first line fails and second succeeds it will overwrite the error code set by the first line and you never know that the first line failed.
E.g.:
Correct:
On Error Resume Next
SubmitRequestHeader()
iErr = Err
If (0 <> iErr) Then
...
SubmitRequestBody()
iErr = Err
On Error GoTo 0
If (0 <> iErr) Then
...
Incorrect:
On Error Resume Next
SubmitRequestHeader()
SubmitRequestBody()
iErr = Err
On Error GoTo 0
If (0 <> iErr) Then
...
Hope that the above will help you somehow...
P.S. If you really need to use runtime script code error handling and did not invest too much to the code yet, my advice would be to consider DelphiScript or JScript both of which support the try/catch/finally runtime code errors/exceptions handling.