Solved

Commit, rollback, etc... with Access???

Posted on 2001-07-24
5
1,237 Views
Last Modified: 2012-05-04
Hi there,

I would like to know if there's a way to execute transactions (begin trans, commit trans and rollback trans) with a ADODB.Connection, from vb 6 using an Access database?

I know the methods to do it exist, but is it possible to use it with Access?

Thanks in advance :)
0
Comment
Question by:Fabulous
5 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6313435
Duplicate question!!!

We call this Replication. Have a look in BOL (books on-line on that topic).
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6313447
Sorry wrong comment!
0
 
LVL 2

Accepted Solution

by:
Caseys95 earned 50 total points
ID: 6314052
0
 
LVL 3

Expert Comment

by:cmgarnett
ID: 6314138
I use the following routine in a database module

Public Sub executeSQLCommand(strSQL As String)

   Set cmd = New ADODB.Command
   cmd.ActiveConnection = cnnMyConnection

   cnnMyConnection.BeginTrans
   
   Debug.Print strSQL
   
   On Error Resume Next
   cmd.CommandText = strSQL
   cmd.Execute
   On Error GoTo 0
   
   cnnMyConnection.CommitTrans
   
   Set cmd = Nothing

End Sub
0
 

Author Comment

by:Fabulous
ID: 6323904
That's what I was looking for. But for some reasons, when I first tried to execute it couple of months ago, it didn't work... But now it's fine!

Thanx!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

829 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