error traping in conn.execute method

Posted on 2003-02-25
Medium Priority
Last Modified: 2006-11-17
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
Question by:abcdefg123456
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

rbagdonas earned 200 total points
ID: 8023104
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


Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question