Y
Yarik
Hi everyone!
I have MS Access 2000 and an ADP project with SQL Server 2000 as a
backend. I have a data-bound form (for example, a continuous form or a
datasheet).
Whenever a user tries to update a record using this form (e.g by moving
from one record to another), I want to do some other changes to the
database (as a most typical example, I want to write a record into a
logging table in the same database). The quick question is: how exactly
am I supposed to make both changes -- the record update that MS Access
form does for me and creation of a log record in another table --
transactional?
By any chance, can I do it by something like this:
-- A call to CurrentProject.Connection.BeginTrans()
in BeforeUpdate event handler.
-- A call to CurrentProject.Connection.CommitTrans()
in AfterUpdate event handler.
-- Calls to CurrentProject.Connection.RollbackTrans()
in BeforeUpdate event handler (if my logging fails)
and... somewhere else (where?) to catch the failure
of the update that the form does for me.
???
Thank you,
Yarik.
I have MS Access 2000 and an ADP project with SQL Server 2000 as a
backend. I have a data-bound form (for example, a continuous form or a
datasheet).
Whenever a user tries to update a record using this form (e.g by moving
from one record to another), I want to do some other changes to the
database (as a most typical example, I want to write a record into a
logging table in the same database). The quick question is: how exactly
am I supposed to make both changes -- the record update that MS Access
form does for me and creation of a log record in another table --
transactional?
By any chance, can I do it by something like this:
-- A call to CurrentProject.Connection.BeginTrans()
in BeforeUpdate event handler.
-- A call to CurrentProject.Connection.CommitTrans()
in AfterUpdate event handler.
-- Calls to CurrentProject.Connection.RollbackTrans()
in BeforeUpdate event handler (if my logging fails)
and... somewhere else (where?) to catch the failure
of the update that the form does for me.
???
Thank you,
Yarik.