Record Lock

Record Lock

Post by Alex Choon » Sat, 12 Apr 1997 04:00:00



Hello,

I have a VB4-16 app accessing a Access 2.0 DB on a Novell 3.X network.
Both the app and DB are on the network. The database is 17Mb ~15500
records. The workstations are running WFW 311. There are normally 5
people accessing the database.

The controls in my applications are NOT bounded.

I seem to get the error 3218 Couldn't Update;Currently Locked. when I
try to save a record.
I've set locking to optimistic - i.e Lockedits = false.

     dbengine.idle

     rsContact.LockEdits = False

     sCrit = "ContactID=" & lContactID

     rsContact.FindFirst sCrit

     If rsContact.NoMatch Then
         Screen.MousePointer = vbDefault
         MsgBox "Cannot Locate Contact ID " & lContactID, vbCritical,
gsAPPNAME
         rsContact.Close
         Exit Sub
     End If

     rsContact.Edit

     etc.

     rsContact.Update

     rsContact.close

 When I call up a record & try to save it, it's fine. When I try to save
 it again, I get the 3218 error message. If I find the record again and
 try to save it, it takes forever to save - I have to reboot the PC to
 stop the save process.

 Can anyone help?

 Thanks in advance.
 Regards
 Alex Choong

 
 
 

Record Lock

Post by Bill Pearso » Sat, 12 Apr 1997 04:00:00


There is a Knowlege Base article on this behavior. I believe that the locks
that are causing the problems are read locks on index pages.  I believe
also that it's recommended that a dbFreeLocks be issued after things like
..Find[First|Last] and Move[First|Last].  My solution to this was to use a
timer control to periodically issue the
dbFreeLocks rather than litering the code with dbEngine.Idle FreeLocks
statements.  
--



Quote:> Hello,

> I have a VB4-16 app accessing a Access 2.0 DB on a Novell 3.X network.
> Both the app and DB are on the network. The database is 17Mb ~15500
> records. The workstations are running WFW 311. There are normally 5
> people accessing the database.

> The controls in my applications are NOT bounded.

> I seem to get the error 3218 Couldn't Update;Currently Locked. when I
> try to save a record.
> I've set locking to optimistic - i.e Lockedits = false.

>      dbengine.idle

>      rsContact.LockEdits = False

>      sCrit = "ContactID=" & lContactID

>      rsContact.FindFirst sCrit

>      If rsContact.NoMatch Then
>          Screen.MousePointer = vbDefault
>          MsgBox "Cannot Locate Contact ID " & lContactID, vbCritical,
> gsAPPNAME
>          rsContact.Close
>          Exit Sub
>      End If

>      rsContact.Edit

>      etc.

>      rsContact.Update

>      rsContact.close

>  When I call up a record & try to save it, it's fine. When I try to save
>  it again, I get the 3218 error message. If I find the record again and
>  try to save it, it takes forever to save - I have to reboot the PC to
>  stop the save process.

>  Can anyone help?

>  Thanks in advance.
>  Regards
>  Alex Choong