I am trying to loop through a recordset and update a single field by taking out the dashes in the phone number in that field. This is the code I'm using. I am getting the error "Cannot Update. Database or Object is Read Only". I thought the OpenKeyset cursortype and adLockOptimistic lock type would allow me to update the recordset? Am I wrong?
rst.Open ("select * from [T-Mobile] where [SUBSCRIBER #]not in ('311641764','Totals')"), Cnxn, adOpenKeyset, adLockOptimistic
rst.MoveFirst
Do While rst.EOF = False
rst![Subscriber #] = CStr(Replace(rst("SUBSCRIBER #"), "-", ""))
rst.MoveNext
Loop
rst.Update
rst.Open ("select * from [T-Mobile] where [SUBSCRIBER #]not in ('311641764','Totals')"), Cnxn, adOpenKeyset, adLockOptimistic
rst.MoveFirst
Do While rst.EOF = False
rst![Subscriber #] = CStr(Replace(rst("SUBSCRIBER #"), "-", ""))
rst.MoveNext
Loop
rst.Update