Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1249
  • Last Modified:

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 :)
0
Fabulous
Asked:
Fabulous
1 Solution
 
É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
 
Caseys95Commented:
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

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now