avoiding error?

J

jodleren

Hello

I keep on getting this error:

Microsoft VBScript runtime error '800a01fb'
An exception occurred: 'ActionDZ'
/modules/jotfileorder/jotfileorder_request_process.asp, line 190

This line causes the problem
ZIPObject.ActionDZ = 4 'DynaZip component

It happens most of the time, but not always. The component is in use
before this line, so the component is created, and probably works.
We can avoid the error be reinstalling an old copy of the file, but
chaning a SQL query, which is not even related to this, we get this
error. Restoring the query does not solve the problem :)

I have been working on this for 3 days, and now the idea is to jump
over. How should this code look like?

on error resume errorstate
ZIPObject.ActionDZ = 4 'DynaZip component
ok=true
goto all ok
errorstate
ok=true
all ok
reset on error... - how?
if ok then.....

WBR
Sonnich
 
B

Bob Barrows

jodleren said:
Hello

I keep on getting this error:

Microsoft VBScript runtime error '800a01fb'
An exception occurred: 'ActionDZ'
/modules/jotfileorder/jotfileorder_request_process.asp, line 190

This line causes the problem
ZIPObject.ActionDZ = 4 'DynaZip component

It happens most of the time, but not always. The component is in use
before this line, so the component is created, and probably works.
We can avoid the error be reinstalling an old copy of the file, but
chaning a SQL query, which is not even related to this, we get this
error. Restoring the query does not solve the problem :)

I have been working on this for 3 days, and now the idea is to jump
over. How should this code look like?

on error resume errorstate

This is not possible in vbscript. The only two acceptable variations
are:

on error resume next 'turns on error-handling
on error goto 0 'turns off error-handling
ZIPObject.ActionDZ = 4 'DynaZip component
ok=true
goto all ok
errorstate
ok=true
all ok
reset on error... - how?
if ok then.....

on error resume next
ZIPObject.ActionDZ = 4 'DynaZip component
if err<> 0 then
'handle the error
else
'do the stuff needed if no error had occurred
'you maight wish to turn off error-handling here
end if
 
J

jodleren

This is not possible in vbscript. The only two acceptable variations
are:

on error resume next    'turns on error-handling
on error goto 0             'turns off error-handling


on error resume next
ZIPObject.ActionDZ = 4  'DynaZip component
if err<> 0 then

Where do I get the "err" from?
    'handle the error
else
    'do the stuff needed if no error had occurred
    'you maight wish to turn off error-handling here

- How?

These are new things to me

WBR
Sonnich
 
B

Bob Barrows

jodleren said:
Where do I get the "err" from?

It's a builtin object that contains the error number generated by the
last statement that was executed.

"How" what? How to turn off error-handling? I explained earlier in my
first reply ...
on error goto 0 'turns off error-handling

The thing is, you have to stop thinking in terms of goto. The idea is to
turn on error-handling, attempt to execute a statement, then immediately
check the err object to see if an error occurred. The model looks like:

<bunch of statements whose errors>
<you want to be handled by the vbscript runtime engine>
on error resume next 'turn on error-handling
<statement whose error you want to handle yourself>
if err <> 0 then
<handle the error, possibly by >
<displaying the error to the user and then >
<exiting the procedure - up to you>
end if
on error goto 0 'turn off error-handling
<bunch of statements whose errors>
<you want to be handled by the vbscript runtime engine>

It sounds as if you need the vbscript documentation. You can download it
from here:
http://www.microsoft.com/downloads/...48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top