Results 1 to 5 of 5

Thread: ASP Err.Number?

  1. #1

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    ASP Err.Number?

    Have this code in an ASP which calls functions in a dll:

    Code:
    'Check for error values
    If Err <> 0 Then
       Select Case Err.Number			
          Case (ERR_INVALID_USER_PASSWORD_SUPPLIED) 
    :
    :
    :
    End If
    The problem is, that for some reason, the ASP is not picking up the Err.Number properly or something, as it ALWAYS uses the first Case in the Select block. I have reordered the Cases, and it always chooses the first one, despite the fact that the internals of the dll raise completely different errors.


    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  2. #2

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    I think the problem is something to do with the ERR constants I created in my .dll.

    I have tried to include the .dll type library with the following in the global.asa file:

    <!-- METADATA
    TYPE="typelib" FILE="C:\Inetpub\wwwroot\nrr\NRRDBAccess.dll" VERSION="1.0"
    -->

    but it doesn't appear to work...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  3. #3
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Does the ASP have something called an Err object, like VB?

    You could imitate VB's Err object inside your DLL, either by using a class or by using a property to hold the error number. Thus the DLL will have an error handler that will set the ErrorNumber property of the DLL to the Err.No of the actual runtime error, and then in your ASP code you could access the DLL's ErrorNumber property to decide if there was any error in the execution and how to handle it.

    It's all probably worth half a cent, as I don't have much knowledge of ASP

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  4. #4
    Addicted Member
    Join Date
    Jun 2001
    Location
    UK
    Posts
    158
    I think the dll has to pass the error number to the page. check whether the dll works that way ?
    [vbcode] On Error GoTo VBForums[/vbcode]
    www27.brinkster.com/muditha

  5. #5

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    The .dll raises a custom error, which *is* caught by the ASP, but I can't seem to get the constants out of the .dll even when I include the typelib in the global.asa file...

    So, I can't check error numbers without writing them explicitly, which is ****.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width