SQL deadlock problem - error trapping

Results 1 to 2 of 2

Thread: SQL deadlock problem - error trapping

  1. #1
    Join Date
    Dec 1969

    Default SQL deadlock problem - error trapping

    I seem to get SQL deadlock errors when site traffic gets heavy.<BR><BR>This may simply be my own bad programming.<BR><BR>I want to redirect folks to a static web page when a SQL error comes up.<BR><BR>If I am using a stored procedure, how do I know if an error occurs? If I could know this, I could do something like if err=1 then response.redirect("errorpage.asp")<BR><BR>Anyone?< BR><BR>(can you tell that I&#039;m self taught on this stuff?)

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL deadlock problem - error trapping

    Well first you do:<BR><BR><BR>ON ERROR GOTO 0<BR>objConn.Errors.Clear<BR><BR><BR>to turn off error handling, and get rid of any old errors<BR><BR>Then, assuming you use the connection object to execute a stored proc:<BR><BR><BR>objConn.Execute ("someStoredProc")<BR>IF objConn.Errors.Count &#062; 0 THEN<BR> &#039;Whoops, some error occured. Check the Error number to see which and take action<BR>ELSE<BR> &#039;everyting went fine<BR>END IF<BR><BR><BR>But if you experience deadlocks a lot you might want to check your coding etc, cause this shouldn&#039;t happen a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts