Re: Changing query at runtime

From: Adrian Jansen (qqv_at_noqqwhere.com)
Date: 03/30/04


Date: Wed, 31 Mar 2004 08:55:33 +1000

Thanks Joan, I already tried that, but after giving the qtemp object Read
Design, Modify Design and even Admin permissions, I still get the "You do
not have the necessary permissions...." error when I change the SQL of the
query in code. It seems to have something to do with the "With owneracces
option" clause in the query. Taking this out lets me modify the SQL, but of
course then the query wont run, since the tables it gets the data from are
secured from the user.

-- 
Regards,
Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
"Joan Wild" <jwild@nospamtyenet.com> wrote in message
news:Ojb7mkmFEHA.3188@TK2MSFTNGP10.phx.gbl...
> Instead of setting up the query in code, just create a query and save it.
>
> Modify the sql property, and give users modify permissions to the query.
>
> -- 
> Joan Wild
> Microsoft Access MVP
>
> "Adrian Jansen" <qqv@noqqwhere.com> wrote in message
> news:406908ef@duster.adelaide.on.net...
> > Hi all,
> >
> > I have developed a multi-user secured database in A2002, standard FE/BE
> > setup.  One of the filter forms creates a query in code, by adding
filter
> > commands to the SQL for the query.  All works ok when the current user
> > creates the query ( assuming it doesnt already exist ), and works with
it.
> > But if another user logs on to the same machine, and attempts to change
> the
> > filter conditions, of course the query doesnt belong to them, and they
> cant
> > modify or delete it.
> >
> > I tried changing the permissions for the query to include read/modify
and
> > even admin for all the groups, but security still wont let another user
> > change the query.  There must be an easy way around this, but I cant
find
> > it.
> >
> > The code I use to set up the query is as follows:
> > ( strSQL contains the full query string, built in code )
> >
> > On Error resume next
> >
> > 'see if query exists
> > Set qdf = CurrentDb.QueryDefs("qtemp")
> >
> >
> > If Error.num = 0  Then
> > 'qtemp exists, reset its definition
> >     qdf.SQL = strSQL
> >
> >   Else
> >
> >     Set qdf = CurrentDb.CreateQueryDef("qtemp", strSQL)
> >   End If
> >
> > I dont want to delete qtemp at this stage, since I want to use it to run
> > reports and set up other forms with the same filter applied.
> >
> > -- 
> > Regards,
> >
> > Adrian Jansen
> > J & K MicroSystems
> > Microcomputer solutions for industrial control
> >
> >
>
>


Relevant Pages

  • Re: User permissions dropping out
    ... I don't see why the user needs 'modify table design' to run an update table query. ... You could achieve this by removing all permissions on the tables for the Read-only user and making the Update Query 'RWOP' (a setting in the properties of the query. ... I must set the permissions to 'modify table design' for a particular table that is updated when the db is opened, thru the 'Autoexec' macro. ...
    (microsoft.public.access.security)
  • Query permissions
    ... I want all users to have read permissions to the data in these forms. ... tables and given Read permissions to my custom users group for each query. ... I've given read, update, modify and delete permissions on each query to the ... group called HugosGroup, and Hugo is the only member of that group (except ...
    (microsoft.public.access.security)
  • Re: Query permissions
    ... Copy the sql from each query for the form and subforms and put the sql in the ... Now Hugo and the Admins group can read, edit, add and delete records in the ... I want all users to have read permissions to the data in these forms. ... I've given read, update, modify and delete permissions on each query to the ...
    (microsoft.public.access.security)
  • Re: Query permissions
    ... permissions from the underlying tableand use only queries to get at the ... only to view data or to be able to modify it through your query. ... I want one user (we'll call him Hugo) to be able to read, update, modify ...
    (microsoft.public.access.security)
  • Re: Changing query at runtime
    ... You can base qtemp on RWOP queries. ... RWOP query for each base table and use these in qtemp. ... > Design, Modify Design and even Admin permissions, I still get the "You do ...
    (microsoft.public.access.security)