Solved

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

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Mysql vs Oracle 10 120
Window placement 17 65
Determine Range to Select 5 33
VB6 - Convert HH:MM into Decimal 8 35
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

757 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

19 Experts available now in Live!

Get 1:1 Help Now