Solved

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

Posted on 2001-07-24
5
1,233 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 69

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 69

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now