Why doesn't rollback work?
Posted on 2003-03-05
Trying to use Rollback in VBA, but any written data persists after rollback.
Here is a little test program I am trying to get working. It runs to completion without any errors, but I end up with a new row in the table:
Dim listRS As New Recordset
listRS.Open "[testtable]", CurrentProject.Connection, adOpenKeyset, adLockPessimistic
listRS![y] = 69
listRS![z] = "stuff"
I am using Access 2000
I have created a brand new empty database with one simple table and this one bit of code (So no issues with migration from Access 97 and earlier).
I have tried using CurrentProject.Connection.BeginTrans and CurrentProject.Connection.RollbackTrans, but I get the error "you tried to commit or rollback without first beginning a transaction".
I also tried specifying "ADODB" for the recordset, as in "Dim listRS As New ADODB.Recordset", but this didn't seem to make any difference at all.
Is this a bug in Access, or am I doing something wrong?