First, I know there is considerable material on this subject but i'm still unable to get past it. Had i known this is so difficult to fix i'd tested before building the app.
Please, find the code snippet and list of what I have already done.
Please help!!!
Code:
QRS = "SELECT ProdFile.[Abstract Bk # & Pg] as PBkPg, BOBTest.[Abstract Bk # & Pg] as BBkPg, ProdFile.[Volume & page #] as PVolPg, BOBTest.[Volume & page #] as BVolPg FROM ProdFile, BOBTest WHERE (((ProdFile.[Abstract Bk # & Pg]) = BOBTest.[Abstract Bk # & Pg]) And ((ProdFile.[Volume & page #]) = BOBTest.[Volume & page #]));"
UpdRS = "UPDATE ProdFile, BOBTest SET BOBTest.[Volume & page #] = BUpdVolPg, WHERE (((ProdFile.[Abstract Bk # & Pg])=BOBTest.[Abstract Bk # & Pg]) And ((ProdFile.[Volume & page #])=BOBTest.[Volume & page #]));"
Set RS = db.OpenRecordset(QRS, dbOpenDynaset, dbPessimistic)
Do While Not RS.EOF
DO STUFF....
RS.Edit 'Line causing the DB or Object is read only
DoCmd.RunSQL UpdRS
'RS.Execute (UpdRS)
BUpdVolPg = ""
RecCnt = RecCnt + 1
RS.MoveNext ' Read next record
Loop
Background: App was originally in OneDrive, moved it to Documents\folder. Two tables were created by importing excel files. Both have primary keys and one indexed field, not the field being updated.
What i have done.
- Verified folder, and MS Access file, is NOT read only.
- Verified folder permissions are set to full and added everyone with full.
- Verified Folders and Files are NOT being shared. properties.sharing.advanced
- Form has allow Additions property = yes but record locks = No Locks
- Created a new small app, in different folder, same result.
- Did compact and repair on the app file.
- Turned off folder read only attribute but it keeps reverting back to read only. Verified Windows Defender "Controlled Folder Access" is OFF! Searched MS support and they state they ignore that attribute yet is seemed a little unclear if it applies to Access data updates. If they don't ignore it, i need a solution for this as well.
- Rebooted PC
- Verified VBA References are good.
- Just a straight up Access app. No server, external connections,
I must/hope have missed something. How do i fix this issue?
Please help !!