Article ID: 106535
Article Last Modified on 10/20/2003
Sub Command1_Click ()
Dim db As database
Set db = OpenDatabase("biblio.mdb")
Dim ds As dynaset
Set ds = db.CreateDynaset("authors")
ds.Edit ' Locks the first record in the dynaset.
MsgBox "First record in dynaset is locked. Press OK to unlock."
command1.Caption = "record now unlocked"
End Sub
Sub Command1_Click ()
Dim db As database
Set db = OpenDatabase("biblio.mdb")
Dim tb As table
' See if table has locks by opening and denying others Read/Write:
On Error Resume Next
Set tb = db.OpenTable("authors", 3) ' 3 = Deny Read & Write (2+1)
If Err = 0 Then
command1.Caption = "not locked"
Else
command1.Caption = "locked due to err=" & err
End If
tb.Close
' If no error here you could reopen table without denying access.
End Sub
Additional query words: 3.00 row locking multiuser
Keywords: KB106535