-
check, if a record is actually locked by another user
Can I check, if a record is actually locked by another
user?
I want allow the user to edit a record (on a form), only
when it isn't locked by another user. Until now I do so
with DAO, the RecordLock Property of the form is set to 2:
On error goto cmdEdit_Click_Err
dim rs as Recordset
set rs = me.recordsetClone
rs.Bookmark = me.bookmark
rs.edit
rs.Update
'hier enable the Text controls.... to allow the user edit
.......
cmdEdit_Click_Exit:
Exit Sub
cmdEdit_Click_Err:
' Record is locked
If Err.Number = 3260 Then
MsgBox Err.Description
Else
MsgBox Err.Number & " " & Err.Description
End If
Resume cmdEdit_Click_Exit
Thanks
le.nhan@web.de
-
Re: check, if a record is actually locked by another user
On 22 Aug 2001 00:51:22 -0700, "Thanh-Nhan Le" <le.nhan@web.de> wrote:
¤
¤ Can I check, if a record is actually locked by another
¤ user?
¤
¤ I want allow the user to edit a record (on a form), only
¤ when it isn't locked by another user. Until now I do so
¤ with DAO, the RecordLock Property of the form is set to 2:
¤
¤ On error goto cmdEdit_Click_Err
¤ dim rs as Recordset
¤ set rs = me.recordsetClone
¤ rs.Bookmark = me.bookmark
¤ rs.edit
¤ rs.Update
¤
¤ 'hier enable the Text controls.... to allow the user edit
¤ ......
¤
¤ cmdEdit_Click_Exit:
¤ Exit Sub
¤
¤ cmdEdit_Click_Err:
¤ ' Record is locked
¤ If Err.Number = 3260 Then
¤ MsgBox Err.Description
¤ Else
¤ MsgBox Err.Number & " " & Err.Description
¤ End If
¤ Resume cmdEdit_Click_Exit
¤
¤
¤ Thanks
¤ le.nhan@web.de
I believe that the RecordLocks property only works with Forms that have fields bound to the database
through a Recordset. It won't work with DAO.
Access 97, Jet/DAO (up to version 3.5) provides locking on 2K page boundaries and not individual
rows. The closest you can come to a solution using the provided DAO methods is via the LockEdits
property.
If you're using Access 2000/Jet 4.0, row-level locking is supported by default, but others users are
not notified when a row is locked by user.
Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks