T
TJ
Hi,
Here is my brief code for transaction testing on linked-table.
I am using MS-ACCESS 2003
TargetTable is linked table, which from sharepiont list.
Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
cnn1.BeginTrans
Set rsTo = New ADODB.Recordset
Set rsTo.ActiveConnection = cnn1
rsTo.CursorLocation = adOpenKeyset
rsTo.LockType = adLockOptimistic
rsTo.Source = "TargetTable"
rsTpen
rsTo.AddNew
rsTo![A] = "Test1"
rsTo! = "Test2"
rsTo.Update
cnn1.RollbackTrans
rsTo.Close
Set rsTo = Nothing
cnn1.Close
Set cnn1 = Nothing
When I tested this code on local table, it worked. In other words, by
roll-back, new record wasn't added in the local table. However, when I tested
this code on the linked table, roll back didn't work. Though RollbackTrans
was executed, new record was still added.
How am I supposed to write for transaction code on linked-table?
Any suggesstion would be greately appreciated.
Thanks.
....................................................................TJ
Here is my brief code for transaction testing on linked-table.
I am using MS-ACCESS 2003
TargetTable is linked table, which from sharepiont list.
Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
cnn1.BeginTrans
Set rsTo = New ADODB.Recordset
Set rsTo.ActiveConnection = cnn1
rsTo.CursorLocation = adOpenKeyset
rsTo.LockType = adLockOptimistic
rsTo.Source = "TargetTable"
rsTpen
rsTo.AddNew
rsTo![A] = "Test1"
rsTo! = "Test2"
rsTo.Update
cnn1.RollbackTrans
rsTo.Close
Set rsTo = Nothing
cnn1.Close
Set cnn1 = Nothing
When I tested this code on local table, it worked. In other words, by
roll-back, new record wasn't added in the local table. However, when I tested
this code on the linked table, roll back didn't work. Though RollbackTrans
was executed, new record was still added.
How am I supposed to write for transaction code on linked-table?
Any suggesstion would be greately appreciated.
Thanks.
....................................................................TJ