Security question about OWNERACCESS

  • Thread starter Thread starter Saintor
  • Start date Start date
S

Saintor

I have a splitted FE/BE Access 97 application. From within FE, all linked
tables have the Administer privilege. Security for the linked tables is
managed directly in the BE.

In the BE, I have a table tblEvent that I clean every time that somebody
logs on with the following instruction;
db1.Execute "delete * from tblEvent WHERE eventOn<=#" & DateAdd("m", -1 *
sMonth, Now()) & "# WITH OWNERACCESS OPTION;"

The owner of the table is "Admin Soramtec" and is part of "Admins" group.
In the Access options, the run permissions is set at owner's.

However, when somebody in "User" group, it tells me that he has no proper
privilege. If I give to the "User" group the delete privilege on the
tblEvent, I have no problem. But isn't why OWNERACCESS OPTION exist? I
have tried to add privilege to "Admin Soramtec" directly instead of only
"Admins", but it does not change anything.

Any idea? TIA.
 
RWOP means run this query as though the owner of the query is running it.
The owner of the query must have the permissions on the underlying table.

You cannot use the WITH OWNERACCESS OPTION in code. When the code is run, a
temp query is created based on the sql statement. That temp query will be
owned by the user running it. Since that user doesn't have delete
permission on tblEvent, it won't work.

An alternative is to create a saved RWOP query based on tblEvent. Then in
code you can use
db1.Execute "Delete * from qryEvent Where .... (and no With Owneraccess
option)
 
Back
Top