|
-
Sep 15th, 2002, 07:02 PM
#1
Thread Starter
PowerPoster
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]
-----------------------------------------
-
Sep 15th, 2002, 09:11 PM
#2
Thread Starter
PowerPoster
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]
-----------------------------------------
-
Sep 16th, 2002, 02:58 AM
#3
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 
.
-
Sep 16th, 2002, 03:40 AM
#4
Addicted Member
I think the dll has to pass the error number to the page. check whether the dll works that way ?
-
Sep 16th, 2002, 05:21 PM
#5
Thread Starter
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|