Ask a Question related to ASP Database, Design and Development.
-
Eric Bobo #1
ASPError Object
Can someone clue me in as to why the following code for Error Object
does not work. The errors get caught, but no information exists in the
Error object fields. If I use the old err.desciption, etc I can see
values and information. What am I doing wrong?
***********************************
Dim objASPError
function junk
On Error Resume Next
'database code here
'update database
RSPayPrem.update
If Err.number > 0 Then
Set objASPError = Server.GetLastError
RSPayPrem.Close
Set RSPayPrem = Nothing
errmessage = "There was a critical error..."
'call function to display error message on error page
'passing error object fields
'(the next line displays on 1 line in code)
'(Display Error is a function with parms)
DisplayError
errmessage,objASPError.ASPCode,objASPError.Number, objASPError.Source,objASPError.Category,objASPErro r.File,objASPError.Line,objASPError.Column,objASPE rror.Description,objASPError.ASPDescription
End If
function end
************************************************** ********
Thanks
Eric
Eric Bobo Guest
-
Dynamically loading user control into Placeholder gives Object reference not set to an instance of an object
I've created user controls that contain listboxes that are dynamically populated from the database. In the html view of the user control... -
Strange error from: Dim myState As Object() = CType(savedState, Object())
Every book and every website I've seen that talks about how to save state for child controls in a composite webcontrol says to do something like... -
Cannot serialize object of type System.Object[,]. Multidimensional arrays are not supported
Hi, I get this on server when trying to retun a 2 dim array. I apprecaite that they are not supported as per... -
ASPError Object problem
I'm attempting to use the ASPError object to generate a custom page when a user encounters a 500-error. I want the page to generate an email to... -
HELP! Error Loading ASPX : Object Reference not set to an instance object
Hello, When i run my aspx i get this weird error: System.NullReferenceException: Object reference not set to an instance of an object. at... -
Aaron Bertrand [MVP] #2
Re: ASPError Object
Server.GetLastError can only work in a 500 error page (e.g. if you set up a
custom error page for 500 errors). Otherwise, you can only use the
rudimentary on error resume next and err.number/err.description solution.
(Not sure what the problem has to do with databases?)
"Eric Bobo" <Eric@EevolutionTechnology.com> wrote in message
news:OJ7it3EfDHA.1872@TK2MSFTNGP09.phx.gbl...errmessage,objASPError.ASPCode,objASPError.Number, objASPError.Source,objASPE> Can someone clue me in as to why the following code for Error Object
> does not work. The errors get caught, but no information exists in the
> Error object fields. If I use the old err.desciption, etc I can see
> values and information. What am I doing wrong?
>
> ***********************************
> Dim objASPError
>
> function junk
> On Error Resume Next
>
> 'database code here
>
> 'update database
> RSPayPrem.update
> If Err.number > 0 Then
> Set objASPError = Server.GetLastError
> RSPayPrem.Close
> Set RSPayPrem = Nothing
>
> errmessage = "There was a critical error..."
> 'call function to display error message on error page
> 'passing error object fields
> '(the next line displays on 1 line in code)
> '(Display Error is a function with parms)
> DisplayError
>
rror.Category,objASPError.File,objASPError.Line,ob jASPError.Column,objASPErr
or.Description,objASPError.ASPDescription> End If
>
> function end
> ************************************************** ********
> Thanks
>
> Eric
>
Aaron Bertrand [MVP] Guest



Reply With Quote

