Presentation is loading. Please wait.

Presentation is loading. Please wait.

A few slides on MS Access Record Locking and Transactions.

Similar presentations


Presentation on theme: "A few slides on MS Access Record Locking and Transactions."— Presentation transcript:

1 A few slides on MS Access Record Locking and Transactions

2 ODBC and Access Record Locking When you edit data in a linked SQL database table using ODBC, Microsoft Access doesn't lock records; instead, the rules of that SQL database govern locking. In this instance, regardless of the record-locking setting you choose for your database, Microsoft Access always acts as though the No Locks setting has been selected.

3 Where to specify locking in Access Advanced tab of tools\options to Set default RecordLocks property –Forms. Specifies how records in the underlying table or query are locked when data in a multiuser database is updated. –Reports. Specifies whether records in the underlying table or query are locked while a report is previewed or printed. –Queries. Specifies whether records in a query (typically an action query in a multiuser database) are locked while the query is run. DAO. LockEdits property of recordset

4 Transaction Methods (Access) BeginTrans begins a new transaction. CommitTrans ends the current transaction and saves the changes. Rollback ends the current transaction and restores the databases in the Workspace object to the state they were in when the current transaction began.

5 Transaction Methods (Access) Sub PostAccounts() ‘Dim and assign variables including tempws, tempdb, temprs, posting Posting = False On Error GoTo ErrorCondition tempws.BeginTrans ' Start of transaction. Posting = True ‘complex set of operations here Posting = False tempws.CommitTrans Alldone ‘release variables ErrorCondition: MsgBox "Error!" If Posting Then tempws.Rollback End If Resume Alldone End Sub

6 Access Record Selector Icons


Download ppt "A few slides on MS Access Record Locking and Transactions."

Similar presentations


Ads by Google