avoiding error?

Discussion in 'ASP General' started by jodleren, Oct 30, 2009.

  1. jodleren

    jodleren Guest

    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
     
    jodleren, Oct 30, 2009
    #1
    1. Advertising

  2. jodleren

    Bob Barrows Guest

    jodleren wrote:
    > 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


    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Oct 30, 2009
    #2
    1. Advertising

  3. jodleren

    jodleren Guest

    On Oct 30, 2:47 pm, "Bob Barrows" <> wrote:
    > jodleren wrote:
    > > 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


    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?

    > end if


    These are new things to me

    WBR
    Sonnich
     
    jodleren, Oct 30, 2009
    #3
  4. jodleren

    Bob Barrows Guest

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

    >
    > 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.

    >> 'handle the error
    >> else
    >> 'do the stuff needed if no error had occurred
    >> 'you might wish to turn off error-handling here

    >
    > - How?
    >


    "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

    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Oct 30, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Takuon Soho
    Replies:
    5
    Views:
    717
    Charles Bailey
    Mar 9, 2005
  2. Wolfgang Kaml
    Replies:
    11
    Views:
    4,306
    Kevin Buchan
    Jan 22, 2004
  3. ton
    Replies:
    3
    Views:
    563
    Sean Chambers
    Sep 18, 2006
  4. Replies:
    3
    Views:
    392
    Martin Golding
    Jan 12, 2007
  5. Replies:
    2
    Views:
    1,470
Loading...

Share This Page