This is part of my case statement, and I can't figure out why it's having problems. When I use objConn.execute after I check it's not EOF, I will get redirected to the condition that IS EOF, BUT the items is still properly deleted. If I comment out the execute statement, it redirects properly.
Sorry if it's obvious, but I seriously can't see WHY. I have similar code on another page and it works fine.
Thanks in advance!
Expand|Select|Wrap|Line Numbers
- case "delete"
- cID = cInt(cleanString(request.QueryString("id")))
- set rs = Server.CreateObject("ADODB.Recordset")
- SQL = "SELECT cName FROM class WHERE cID = " & cID
- 'response.Write(sql)
- 'response.End()
- 'Open connection
- rs.Open SQL, objConn
- if rs.eof then
- closeRS(rs)
- closeConn()
- response.Redirect("admin.asp?page=class" & "&statusMsg=failed") 'THIS LINE IS EXECUTED IF I USE objConn.execute IN THE NEXT SECTION
- response.End()
- else
- 'objConn.open
- objConn.execute("DELETE FROM class WHERE cID=" & cID)
- closeRS(rs)
- closeConn()
- response.Redirect("admin.asp?page=class" & "&statusMsg=delOK") 'THIS LINE WON'T EXECUTE IF I USE objConn.execute
- response.End()
- end if
- 'end case DELETE