Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Error handling

Status
Not open for further replies.

ufobaby

MIS
Sep 25, 2001
238
US
dear all,
i have understood that we can redirect all errors to a custom page and display a whole lot of information to the user etc etc ... but still got a very basic doubt.

Example :
I have a page which uploads a file to the database. There could be errors on this page. how do i do a rollback transaction if an error occurs on this page and avoid updating partial data in the database.

assuming i have the custom error page setup. PLS HELP.

__________
[cheers]
Niraj...
"The unexpected success is not just an opportunity for innovation. It demands innovation."
[noevil]
 
thanks, i also tried the ADODB Begin / Commit / Rollback Trans it worked... but now another issue with this

say i have a hughe file for upload, and error occures at line number 1000, the program will still continue to read and attempt to write, then at the end it will give anr error and rollback

is there a way to redirect to an error page as soon as the error occurs ?

__________
[cheers]
Niraj...
"The unexpected success is not just an opportunity for innovation. It demands innovation."
[noevil]
 
Maybe something like:

Code:
' up at the top
On Error Resume Next

' after you open the connection and start doing stuff
If err <> 0 then
   ' do your clean up
   Response.Redirect("myErrorPage?errDescription=" & err.Description)
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top