Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Rollback using ADO.Recordset!

Posted on 2002-04-15
Medium Priority
Last Modified: 2008-03-06

I use ADO to add/update/delete record to my Oracle DB.

In using a recrodset's method --> AddNew, Update.

Do I need to do a rollback if the AddNew, Update fails?

If yes, how can I do this?

I found there exists a rollback method at the conneciton object, but not at recordset object.

My table at oralce db contains a field which is of type BLOB.

I only know how to use the recordset object to add record to this table which will add a binary file to the database.

In my case, how can I do a rollback if the operation fails?

Thanks for your advice!
Question by:DoraMeMe
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
LVL 43

Expert Comment

ID: 6941384
DoraMeMe: You need to use the following methodology to incorporate rollback/commit process. It is effectively the same as the transaction control methods you would apply in your oracle stored procedures or scripts just implemented through ADO.

- Pseudo-code :

If Connection.Errors.Count > 0 Then 'Rollback
End If

Everything contained in the Recordset.ProcessData section is contained within the transaction and all actions will be either committed or rolled back at the end of the process.

As for the necessity of doing a rollback etc for an addnew/update, it all depends on your database, the criticality of the data etc.

Accepted Solution

corvanderlinden earned 200 total points
ID: 6941480
If you do not use transactions and the AddNew or Update fails you do not need to rollback, it just fails

Expert Comment

ID: 6942075
corvanderlinden is correct for the single action (insert/update) you have internal transactions.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Expert Comment

ID: 6943105
Unless you are proposing that you are updating mutliple tables with in one transactions
sub thisSub()
On error goto ErrHandl
exit sub sub


end sub

LVL 49

Expert Comment

ID: 7654082
Hi DoraMeMe,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: TimCottee and corvanderlinden

DoraMeMe, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 7755273
per recommendation

Community Support Moderator @Experts Exchange

TimCottee points for you at:

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

604 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