Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: ASP page does not receive an Error Raise from Dll


Message #1 by "MIchael Dever" <mdever@d...> on Wed, 10 Jul 2002 16:52:42
Hi,

My ASP page is not receiving any error raised by my .DLL.
Is this a known bug, or am I coding something wrong?

Method inside my class inside my DLL:

Public Sub setLap(ByVal strInLap As String)
  Dim strALap As String
  
  On Error Resume Next
  
  strALap = Trim(strInLap)
  If (Len(strALap) <> 6) Then
    Err.Raise 2110, "CAF861Ven.setLap", "Length of Lap > 6 chars"
    strLap = RPad(strALap, 6)
  Else
    strLap = strALap
  End If
End Sub


ASP Page calling the object and using it:

  set o861Ven = Server.CreateObject("StoresAF861Ven.CAF861Ven")
  o861Ven.setLap( "TooLongData" )
  if ( ERR.number <> 0 ) then
    Response.Write( "We Got A Error!" )
  else
    Response.Write( "Nope, Can't see no error here." )
  end if

thanks,
mike
Message #2 by "J House" <jesse@s...> on Fri, 12 Jul 2002 06:24:31
try commenting out 'On Error Resume Next
no true error is being generated, you are raising it on your own, then On 
Error Resume Next ignores it and continues with execution.
this is just a guess, could be something else.

 >  
 >  strALap = Trim(strInLap)
 >  If (Len(strALap) <> 6) Then
 >    Err.Raise 2110, "CAF861Ven.setLap", "Length of Lap > 6 chars"
 >    strLap = RPad(strALap, 6)

  Return to Index