Results 1 to 13 of 13

Thread: [RESOLVED -FINALLY :-) ] could not update; currently locked

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    [RESOLVED -FINALLY :-) ] could not update; currently locked

    I have this intermittent error (could not update; currently locked). Occuring intermittently in a database write loop at random locations.

    This has me pulling my hair out as it only happens intermittently (more on larger databases) and at RANDOM locations in the loop ... even when nothing changes from run to run.

    This happens on many different computers and many different database files.

    Any help greatly appreciated!

    The database is an mdb file on the same drive as the app.
    error occurs at random update statements.
    There is NO multiuser access ... only the single access.
    PSUEDOCODE follows:
    VB Code:
    1. Dim rst As New ADODB.Recordset
    2.     Dim rst2 As New ADODB.Recordset
    3.     Dim rst3 As New ADODB.Recordset
    4.     Dim rst4 As New ADODB.Recordset
    5.  
    6.         strTemp = "SELECT * FROM aa WHERE bb = 1"
    7.         rst.Open strTemp, cnn, adOpenDynamic, adLockOptimistic
    8.        
    9.        
    10.         strTemp = "SELECT * FROM cc WHERE dd = 1"
    11.         rst2.Open strTemp, cnn, adOpenDynamic, adLockOptimistic
    12.        
    13.  
    14.         strTemp = "SELECT * FROM ee WHERE ff = 1"
    15.         rst3.Open strTemp, cnn, adOpenDynamic, adLockOptimistic
    16.        
    17.  
    18.         strTemp = "SELECT * FROM gg WHERE hh = 1"
    19.         rst4.Open strTemp, cnn, adOpenDynamic, adLockOptimistic
    20.  
    21. for i = 1 to 1000
    22.     rst2.AddNew
    23.     rst2!aaaa = bbbb
    24.     rst2.Update
    25.  
    26.     rst3.AddNew
    27.     rst3.Fields("cccc") = dddd
    28.     rst3.Update
    29.  
    30.     rst4.AddNew
    31.     rst4.Fields("eeee") = ffff
    32.     rst4.Update
    33.  
    34.     rst.AddNew
    35.     rst.Fields("gggg") = hhhh
    36.     rst.Update
    37. next i
    38.  
    39.     rst.Close
    40.     rst2.Close
    41.     rst3.Close
    42.     rst4.Close
    43.    
    44.     Set rst = Nothing
    45.     Set rst2 = Nothing
    46.     Set rst3 = Nothing
    47.     Set rst4 = Nothing
    Last edited by Muddy; Apr 2nd, 2007 at 10:24 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width