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

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 :)
FabulousAsked:
Who is Participating?
 
Caseys95Commented:
0
 
Éric MoreauSenior .Net ConsultantCommented:
Duplicate question!!!

We call this Replication. Have a look in BOL (books on-line on that topic).
0
 
Éric MoreauSenior .Net ConsultantCommented:
Sorry wrong comment!
0
 
cmgarnettCommented:
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
 
FabulousAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.