-
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.
:confused:
-
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...
:confused:
-
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 :o
.
-
I think the dll has to pass the error number to the page. check whether the dll works that way ?
-
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 ****.