03Explorer
Technical User
I am trying to update current record being processed in a loop based on a SQL statement. But I am getting the error "3027: Cannot update. Database or object is read-only."
I also tried using the following to get the same result
I also tried using 'dbOpenSnapshot' instead of 'dbOpenDynaset' "Operation is not supported for this type of object".
Code:
Set rsGenerateMe = CurrentDb.OpenRecordset(SQL, dbOpenDynaset, dbFailOnError + dbSeeChanges)
If Not (rsGenerateMe.EOF And rsGenerateMe.BOF) Then
rsGenerateMe.MoveFirst
Do Until rsGenerateMe.EOF = True
[COLOR=#CC0000]'Errors on line below[/color]
[COLOR=#4E9A06]'3027: Cannot update. Database or object is read-only.[/color]
rsGenerateMe.Edit
rsGenerateMe!GeneratedYn = 1
rsGenerateMe!GeneratedBy = GetLogonName()
rsGenerateMe!GeneratedDT = Now()
rsGenerateMe!SurveyNumberID = rsProjectDetails!SurveyNumber
rsGenerateMe.Update
rsGenerateMe.MoveNext
Loop '-- rsGenerateMe
I also tried using the following to get the same result
Code:
With rsGenerateMe
.Edit
!GeneratedYn = 1
!GeneratedBy = GetLogonName()
!GeneratedDT = Now()
!SurveyNumberID = rsProjectDetails!SurveyNumber
.Update
End With
I also tried using 'dbOpenSnapshot' instead of 'dbOpenDynaset' "Operation is not supported for this type of object".