06/05/2020, 14:45
accessman
https://codekabinett.com/rdumps.php?Lang...ransaction
adresinde anlatılıyor ama ben çok anlayamadım
adresinde anlatılıyor ama ben çok anlayamadım
Public Sub TransactionDemo()
On Error GoTo tran_Err
DAO.DBEngine.BeginTrans
CurrentDb.Execute "INSERT INTO tblLog (Text1) VALUES ('New banana delivery')", dbFailOnError
CurrentDb.Execute "UPDATE tblInfo SET InfoText = 'Banana count: 2983' WHERE ID = 6 ", dbFailOnError
CurrentDb.Execute "DELETE FROM tblTemp", dbFailOnError
DAO.DBEngine.CommitTrans
Exit Sub
tran_Err:
DAO.DBEngine.Rollback
MsgBox "Transaction failed. Error: " & Err.Description
End Sub