Re: Object permissions



Setting WITH OWNERACCESS OPTION in code is pointless, since the owner in
this case will the user running it and they may not (probably don't have)
permission on the underlying tables. You should be able to get it working if
you grant modify permission on the qryAttendanceActual query.

--
Joan Wild
Microsoft Access MVP

Scott wrote:
Thank you for the replies, but it really doesn't matter whether I'm
trying to change the owner to a group or an individual, it still says
that I don not have the permission to change the object's
owner....but I am the owner of that object, so I should have the
permission to change it. Also, I do set the querie's run permissions
to 'owners' in the sql statement each time the code runs, but it
isn't that the person running the code doesn't have permission to run
the query, they can actually open the query once the sql is set. They
just can't set the sql itself. Below is the code used to set the sql
for the query:

'set query for attendance logs
strSQLAttendance = _
"SELECT tblPayroll.CompNo, Month([Date]) AS [Month],
Day([Date]) AS [Day], " & _
"tblPayroll.Date, Sum(tblPayrollDetails.Hrs) AS
SumOfHrs, " & _
"tblEmployees.EmployeeLastName,
tblEmployees.EmployeeFirstName, " & _
"tblPayroll.Reason, First(tblPayroll.HrsMissed) AS
FirstOfHrsMissed, " & _
"tblAttendanceReasonCodes.AbsenceTypeID " & _
"FROM ((tblPayroll INNER JOIN tblEmployees ON
tblPayroll.CompNo = tblEmployees.CompNo) " & _
"LEFT JOIN tblPayrollDetails ON tblPayroll.PayID =
tblPayrollDetails.PayID) " & _
"INNER JOIN tblAttendanceReasonCodes ON
tblPayroll.Reason = " & _
"tblAttendanceReasonCodes.AttendanceReasonCodeID "
& _ "WHERE (((tblEmployees.EmployeeNo) =" & EmpNo & ") And
((Year([Date])) =" & _
varYear & ")) " & _
"GROUP BY tblPayroll.CompNo, Month([Date]), Day([Date]),
tblPayroll.Date, " & _
"tblEmployees.EmployeeLastName,
tblEmployees.EmployeeFirstName, tblPayroll.Reason, " & _
"tblAttendanceReasonCodes.AbsenceTypeID " & _
"ORDER BY tblEmployees.EmployeeLastName,
tblEmployees.EmployeeFirstName " & _
"WITH OWNERACCESS OPTION "
Set objQDF = CurrentDb().QueryDefs("qryAttendanceActual")
objQDF.SQL = strSQLAttendance
objQDF.Close

"'69 Camaro" wrote:

Hi, Joan.

You can, and I have, made a group the owner of an object.

Doh! Thanks for the correction. I could have sworn I've done the
same thing as Scott and received the same error message because I
accidentally grabbed the group name, not the user name when I
assigned the new owner. I can see that there's no such problem when
I try it now.

Thanks.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and
tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for
contact info.


"Joan Wild" <jwild@xxxxxxxxxxxxxxxx> wrote in message
news:upJGqprIHHA.5104@xxxxxxxxxxxxxxxxxxxxxxx
'69 Camaro wrote:
So I tried to change the object's owner to the group "Admins"
. . .
Am I missing something here?

Yes. You may assign one -- and only one -- user as the new owner
of the object. A group is not a user. A group contains zero to
many users as members, so a group is related conceptually to
users, but a group can't substitute for a user as the "owner."

You can, and I have, made a group the owner of an object. Doesn't
matter in Scott's case, but I thought I'd point out that this can
be done.

--
Joan Wild
Microsoft Access MVP


.



Relevant Pages

  • msystables? / users saving their own queries?
    ... I want the users of this system to be able to save custom queries based on ... tables that they have permission to and run and save a query. ... MSysObjects -> owner is Engine ...
    (microsoft.public.access.security)
  • Re: Object permissions
    ... Who is the owner of the query? ... permissions does the owner have on the underlying tables? ... does the user have on the query; ... to 'owners' in the sql statement each time the code runs, ...
    (microsoft.public.access.security)
  • Re: Access 2002 Help required please......
    ... > Whats a RWOP query? ... that means 'run with owner permissions'. ... the query owner may have read/update/insert permission on the ... You can get more information on RWOP in the security FAQ and whitepaper. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Access 2002 Help required please......
    ... > Whats a RWOP query? ... that means 'run with owner permissions'. ... the query owner may have read/update/insert permission on the ... You can get more information on RWOP in the security FAQ and whitepaper. ...
    (microsoft.public.access.security)
  • Re: groups vs users
    ... , Dave Stratford wrote: ... owner would be the owner of the directory and NOT the primary ... The '2xxx' permission on a directory has been described upthread. ... The not-very-useful permissions of 2740 (SGID, but without the execute ...
    (comp.os.linux.setup)