So, this is my first go-around with trying to write ADO transactions into an Access database. Nothing fancy, just trying to work with a single-file Access DB.
Here's an example of syntax that I can't figure out why is failing:
When I run TestTransaction with either a value of true or false, it fails with the error:
You tried to commit or rollback a transaction without first beginning a transaction.
What am I doing wrong?
----------
Jeff Wigal
jeff@wigaldesign.com
Referee Assistant for MS Access
Here's an example of syntax that I can't figure out why is failing:
Code:
Function TestTransaction(commit As Boolean)
CurrentProject.Connection.BeginTrans
CurrentProject.Connection.Execute "INSERT INTO ErrorLog ([User]) VALUES ('Hey There');"
If commit Then
CurrentProject.Connection.CommitTrans
Else
CurrentProject.Connection.RollbackTrans
End If
End Function
When I run TestTransaction with either a value of true or false, it fails with the error:
You tried to commit or rollback a transaction without first beginning a transaction.
What am I doing wrong?
----------
Jeff Wigal
jeff@wigaldesign.com
Referee Assistant for MS Access