Locking Question

Tsango

Registered User.
Local time
Today, 18:16
Joined
Mar 31, 2006
Messages
64
If I run the following code below on two PC's at the same time accessing the backend database, "zz_LockTest", one of them errors with the message

Microsoft Jet Database engine stopped the process because you and another user are attempting to change the data at the same time.

I thought that the lock that I had applied would sort this out.

How can I stop this error???


Code:
Set cnn = CurrentProject.Connection
    
cnn.CursorLocation = adUseServer
    
For a = 1 To 500

     rstTestLock.Open "zz_LockTest", cnn, adOpenDynamic, adLockPessimistic, adCmdTable
     rstTestLock.MoveFirst
     rstTestLock!Change = a
     rstTestLock.Update
     rstTestLock.Close
        
Next a
    
Set cnn = Nothing
 
Last edited:

Users who are viewing this thread

Back
Top Bottom