473,416 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,416 developers and data experts.

ADO Transaction Processing

ADezii
8,834 Expert 8TB
In the Tip of the Week #19, we demonstrated Transaction Processing, specifically as it applies to DAO (Data Access Objects). In this week's Tip, we'll illustrate how Transaction Processing can be used within the context of ADO (ActiveX Data Objects). Please refer to the Link below if you wish to see an Overview of Transaction Processing, how it is implemented within DAO, or special issues to be aware of when utilizing Transaction Processing in general.

TheScripts Tip of the Week #19 - DAO Transaction Processing

In this Tip, we'll concentrate on the ADO aspect of this process. The below listed code shows the basic, skeletal format, for Transaction Processing in ADO:
Expand|Select|Wrap|Line Numbers
  1. On Error GoTo Err_Handler
  2. Dim cnn As ADODB.Connection
  3. Dim blnInTrans As Boolean
  4.  
  5. blnInTrans = False        'not in a Transaction as of yet
  6. Set cnn = CurrentProject.Connection
  7. '...
  8.  
  9. cnn.BeginTrans
  10.   blnInTrans = True       'now in the beginning of a Transaction
  11.   'any series of data changes here
  12. cnn.CommitTrans
  13.   blnInTrans = False      'Transactions completed without Error
  14.  
  15. '...
  16.  
  17. Exit_Handler:
  18.   Exit Sub
  19.  
  20. Err_Handler:
  21.   If blnInTrans Then      'in the midst of a Transaction
  22.     cnn.RollbackTrans     'Restore data to pre-Transaction state
  23.   End If
  24.   'further Error processing here
  25.   Resume Exit_Handler
NOTE: You can see that the code is very similar to the DAO version, except that the Transaction Processing Methods in ADO, (BeginTrans, CommitTrans, and RollbackTrans), are Methods of the Connection Object rather than the Workspace Object in DAO. In addition, the DAO RollBack Method is named RollbackTrans in ADO.
Jul 14 '07 #1
0 17487

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: JJ_377 | last post by:
I need some suggestions on resources for learning about transaction processing. I have an excellent SQL reference that gives the syntax...and basic concepts but I am also interested in real world,...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
15
by: Zeng | last post by:
Hi, The bigger my C# web-application gets, the more places I need to put in the tedious retrying block of code to make sure operations that can run into database deadlocks are re-run (retried)...
3
by: rdemyan via AccessMonster.com | last post by:
I have some unbound forms that I want to use transaction wrappers on when updating the table. My question is on the scope of what transaction processing will do. I'm going to keep it simple with...
0
by: ikogan | last post by:
The first release of the Transaction Processing over XML (TPoX) database benchmark took place last week! Please take a look at tpox.sourceforge.net. The benchmark consists of XML schemas, XML...
4
by: Shelly | last post by:
I am looking for some advice on the design of a transaction processing sequence. As I xcurrently have it, the sequence is as follows: 1 - Gather all the information from the user other than the...
0
by: ikogan | last post by:
In January, I announced our TPoX benchmark that became public on tpox.sourceforge.net. We just had its next release. What is new? (1) TPoX 1.1 contains six sub-document XML level updates. ...
1
ADezii
by: ADezii | last post by:
Transaction Processing is a Database term that refers to the process of grouping changes to your data into a batch that is treated as a single, atomic unit. Either the entire batch of transactions...
1
by: Terry VanDamme | last post by:
Hello, I am attempting to write an application where I have code segregation where code dealing with the form is located in the form which relies on a class module (ie clsOrders) and all code that...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.