Download Record Locking

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Entity–attribute–value model wikipedia , lookup

File locking wikipedia , lookup

SQL wikipedia , lookup

PL/SQL wikipedia , lookup

Commitment ordering wikipedia , lookup

Database wikipedia , lookup

Expense and cost recovery system (ECRS) wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Microsoft Access wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Serializability wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Database model wikipedia , lookup

Versant Object Database wikipedia , lookup

Concurrency control wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Transcript
A few slides on MS Access Record
Locking and Transactions
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.
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
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.
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
Access Record Selector Icons