error traping in conn.execute method

i am executing one delete query. i have conn as my adodb.connection object. now, i am writing conn.execute(delete_query_sql). there are chance of having child records of one i m trying to delete. so it throws asp error. i want to trap it and want my page to redirect to an error page. how can i come to know that whether my query is executed successfuly or not ? does it return anything like 0 or 1 ? (liek jsp) please reply me immediately. thanks. Nirav Mithani
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

rbagdonasConnect With a Mentor Commented:
Simple.  You need to activate error catching with:

on error resume next

'create the connection
set Conn = ....

'open the connection
Conn.Open Connstring

'execute the delete query
Conn.Execute delete_query_sql

'0 is the return code if everything worked fine
if Err.Number <> 0
  'send them to the error page
  Response.redirect "/error.asp?ErrorNumber=" & Err.number
end if

All Courses

From novice to tech pro — start learning today.