With OwnerAccess Option

  • Thread starter Thread starter Douglas
  • Start date Start date
D

Douglas

Why is it that when I create an Update query and set Run
Permissions to Owner that a user who has no table
permissions can run the query and update the
table...but...when I tried: DoCmd.RunSQL "Update Table01
SET Field02 = 'Test' WITH OWNERACCESS OPTION;" I got an
error that the user does not have permissions. I thought
I was doing the same thing as in the query.

Thank you for your help.
 
No it isn't the same thing. When you 'run' a sql statement in code, Access
creates a temporary query and runs it. The WITH OWNERACCESS OPTION in code
is pointless. The user that runs it will own the temporary query, and as
owner with no permissions on the underlying query, gets nowhere.

Either create a saved RWOP query based on Table01 (then run an update on the
RWOP query)
or create a saved RWOP update query and run it
 
Back
Top