I put in this code to catch a 500 error. I want the page to continue running and not move the user to a different page.
with the code, if the connection works fine, the page loads and the information is inserted into the database.
If the connection doesn't work, the page keeps running in a circle and causes a timeout.
What did I put wrong?
<% connectionComplete = "false"On Error Resume Next If err.Number = 0 Then if myConn.State = 1 then On Error Goto 0Set press_cmd = Server.CreateObject ("ADODB.Command")press_cmd.ActiveConnection = myConnpress_cmd.CommandText = "SELECT * FROM dbo.k4kPressRelease ORDER BY date DESC"press_cmd.Prepared = trueOn Error Resume NextIf err.Number = 0 ThenSet press = press_cmd.ExecuteconnectionComplete = "true"press_numRows = 0end ifend if elseconnectionComplete = "false" ' Error trapping - connection failedend if%>
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
On Error Goto 0