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

  2. jodleren

    Bob Barrows Guest

    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
    'handle the error
    else
    'do the stuff needed if no error had occurred
    'you maight wish to turn off error-handling here
    end if
     
    Bob Barrows, Oct 30, 2009
    #2
    1. Advertisements

  3. jodleren

    jodleren Guest

    Where do I get the "err" from?
    - How?
    These are new things to me

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

    Bob Barrows Guest

    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 ...
    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
     
    Bob Barrows, Oct 30, 2009
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.