error.number is number?

On error resume next
If err.number = (-2147467261) or err.number = 0 then
open pdf file
Response.End()
Else
response.write "another error"
End If


everytime it sees the error with that number or equal to 0 it will go open the pdf file. If there is any other error it should print out the else statment.
Yet some how thatdoesnt work, if theres error like -2147467261 then it will bring the pdf up. If i take out the or err.number =0 and i got no error it still go in to the if and open the pdf file. And if there's another error it just give me blank page not the response.write "another error" line. Could anyone explain or help me with this. Thanks alot


Answer this question

error.number is number?

  • Brian.Nelson

    I smell VB6...But anyway after processing the error code you need to clear the error using err.clear:

    On error resume next
    If err.number = (-2147467261) or err.number = 0 then
    open pdf file
    Response.End()
    Else
    response.write "another error"
    End If

    err.Clear()



  • TruePsion

    nope, it still doesnt work. i'm using vbscript on an asp file.
  • xyte

    nope, it still doesnt work
  • error.number is number?