Hi all...
I want to delete the 5 years ago's databases and there is an error occur in the line "rs.delete" . Below is my code.
The error is:
"Row cannot be located for updating. Some values may have been changed since it was last read."
This error will occur when rs reach the row that it should be deleted. What should I do?? Thanks for help.
I want to delete the 5 years ago's databases and there is an error occur in the line "rs.delete" . Below is my code.
The error is:
"Row cannot be located for updating. Some values may have been changed since it was last read."
This error will occur when rs reach the row that it should be deleted. What should I do?? Thanks for help.
Code:
rs.MoveFirst
Do While (rs.EOF <> True)
If (DateDiff("yyyy", rs.Fields("dateVar"), Now()) >= 5) Then
'MsgBox DateDiff("yyyy", rs.Fields("dateVar"), Now())
rs.delete
End If
'rs.Update
rs.MoveNext
Loop
Comment