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:
Dim rst As New ADODB.Recordset Dim rst2 As New ADODB.Recordset Dim rst3 As New ADODB.Recordset Dim rst4 As New ADODB.Recordset strTemp = "SELECT * FROM aa WHERE bb = 1" rst.Open strTemp, cnn, adOpenDynamic, adLockOptimistic strTemp = "SELECT * FROM cc WHERE dd = 1" rst2.Open strTemp, cnn, adOpenDynamic, adLockOptimistic strTemp = "SELECT * FROM ee WHERE ff = 1" rst3.Open strTemp, cnn, adOpenDynamic, adLockOptimistic strTemp = "SELECT * FROM gg WHERE hh = 1" rst4.Open strTemp, cnn, adOpenDynamic, adLockOptimistic for i = 1 to 1000 rst2.AddNew rst2!aaaa = bbbb rst2.Update rst3.AddNew rst3.Fields("cccc") = dddd rst3.Update rst4.AddNew rst4.Fields("eeee") = ffff rst4.Update rst.AddNew rst.Fields("gggg") = hhhh rst.Update next i rst.Close rst2.Close rst3.Close rst4.Close Set rst = Nothing Set rst2 = Nothing Set rst3 = Nothing Set rst4 = Nothing




Reply With Quote