PC Review


Reply
Thread Tools Rate Thread

Block copy with query result

 
 
=?Utf-8?B?R29yZG9u?=
Guest
Posts: n/a
 
      10th May 2005
I am trying to block Ctrl-C copy, Insert, Delete etc.. for data in my
database application. I have successfuly blocked copying, deleting, inserting
etc when data is displayed in a form or a report but have not been able to
figure out how to do this when it is displayed in a query result page.

Any ideas are welcome, I want to prevent the user from being able to change
the data, copy or print it when displayed in a query result.

Thanks,
Gordon
 
Reply With Quote
 
 
 
 
Joan Wild
Guest
Posts: n/a
 
      10th May 2005
"Gordon" <(E-Mail Removed)> wrote in message
news:2E760394-7E21-4D7B-8343-(E-Mail Removed)...
>I am trying to block Ctrl-C copy, Insert, Delete etc.. for data in my
> database application. I have successfuly blocked copying, deleting,
> inserting
> etc when data is displayed in a form or a report but have not been able to
> figure out how to do this when it is displayed in a query result page.
>
> Any ideas are welcome, I want to prevent the user from being able to
> change
> the data, copy or print it when displayed in a query result.



I don't believe you can prevent copying (and am curious how you managed to
do so in a form). However you can hide the database window so users can't
even get to the queries to open any. Create your own custom toolbars/menus
that restrict what they can do. Look at the settings in Tools, Startup for
other things to hide. You'll also want to disable the shiftkey bypass. See
http://www.mvps.org/access/modules/mdl0011.htm
and
http://www.mvps.org/access/general/gen0040.htm

--
Joan Wild
Microsoft Access MVP


 
Reply With Quote
 
TC
Guest
Posts: n/a
 
      11th May 2005

Joan Wild wrote:

(snip)

> I don't believe you can prevent copying (and am curious how you

managed to
> do so in a form).


Trap ctrl-c etc.!

TC

 
Reply With Quote
 
=?Utf-8?B?R29yZG9u?=
Guest
Posts: n/a
 
      11th May 2005
I have blocked Ctrl-C and other keystrokes for forms and reports, How can I
do this for a query result that is displayed. I used the Form_KeyDown event
on the forms, and set properties for the reports, I've even turned things off
using the auto-keys macro. I need to allow, disallow copy dynamically based
on user rights to the data but have not been able to find a way to set the
"properties" or run code associated with a query result. I also need to be
sure users can't delete, insert or change data from a query result.

There are querydef configs in the querydefs collection, but they are
relative to the query itself, the not result set and window of data returned.
I don't even know what to call the query result screen, its not a report,
query, form or table.

Help would really be appreciated.

Gordon

"TC" wrote:

>
> Joan Wild wrote:
>
> (snip)
>
> > I don't believe you can prevent copying (and am curious how you

> managed to
> > do so in a form).

>
> Trap ctrl-c etc.!
>
> TC
>
>

 
Reply With Quote
 
Joan Wild
Guest
Posts: n/a
 
      11th May 2005
"Gordon" <(E-Mail Removed)> wrote in message
news:3811D75F-2E8F-4345-8248-(E-Mail Removed)...
>I have blocked Ctrl-C and other keystrokes for forms and reports, How can I
> do this for a query result that is displayed.


Simple answer is that you can't; a query has no events you can hook into.

> I also need to be
> sure users can't delete, insert or change data from a query result.


If you've implemented security, then you can deny them delete/insert/update
permissions on the query.

Again I ask, why are users even seeing any queries. You should restrict the
frontend more by allowing data interaction only through forms and reports.
Create your own toolbars/menubars to restrict what they can do, and change
the settings in Tools, startup so they can't get to the database window.
Set a startup form.


--
Joan Wild
Microsoft Access MVP


 
Reply With Quote
 
Paul Overway
Guest
Posts: n/a
 
      12th May 2005
If you're really this concerned about not allowing them to copy, you should
display a form or a report instead of a query. But realistically, if you
have given permissions to read the data....users can do whatever they want
with it. You might be making it a little more difficult, but they can still
do it. Sounds like a big waste of time to me.

--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


"Gordon" <(E-Mail Removed)> wrote in message
news:3811D75F-2E8F-4345-8248-(E-Mail Removed)...
>I have blocked Ctrl-C and other keystrokes for forms and reports, How can I
> do this for a query result that is displayed. I used the Form_KeyDown
> event
> on the forms, and set properties for the reports, I've even turned things
> off
> using the auto-keys macro. I need to allow, disallow copy dynamically
> based
> on user rights to the data but have not been able to find a way to set the
> "properties" or run code associated with a query result. I also need to
> be
> sure users can't delete, insert or change data from a query result.
>
> There are querydef configs in the querydefs collection, but they are
> relative to the query itself, the not result set and window of data
> returned.
> I don't even know what to call the query result screen, its not a report,
> query, form or table.
>
> Help would really be appreciated.
>
> Gordon
>
> "TC" wrote:
>
>>
>> Joan Wild wrote:
>>
>> (snip)
>>
>> > I don't believe you can prevent copying (and am curious how you

>> managed to
>> > do so in a form).

>>
>> Trap ctrl-c etc.!
>>
>> TC
>>
>>



 
Reply With Quote
 
=?Utf-8?B?R29yZG9u?=
Guest
Posts: n/a
 
      12th May 2005
The reason for the query is that users download a subset of a sql data
database, we control how long they can look at it via a license server (its
encrypted until access tables are populated), and what they can do with the
data view, print, copy - it just the way it is. The idea for them to bring
the data into Access was so that they could then create their own more
detailed queries of the data they were approved to download and analyze. A
user can then create a query to get the subset of the data they have and then
create and run reports off of that. Users have no access to the original sql
database, only to the subset they download, and then only through reports and
queries they generate, everything is locked down, no export, no save as
etc...

You say I can prevent delete, insert, and changing data from/in the query,
but the queries are dynamic and created by the user, how do I set the query
attributes to do this once the query is done? Is the a parameter of a
querydef? If I know how to reference the query and turn these properties off
I can do it but I am having a problem finding how to turn them off (I found
it with tables but not queries)

Thanks again -

"Joan Wild" wrote:

> "Gordon" <(E-Mail Removed)> wrote in message
> news:3811D75F-2E8F-4345-8248-(E-Mail Removed)...
> >I have blocked Ctrl-C and other keystrokes for forms and reports, How can I
> > do this for a query result that is displayed.

>
> Simple answer is that you can't; a query has no events you can hook into.
>
> > I also need to be
> > sure users can't delete, insert or change data from a query result.

>
> If you've implemented security, then you can deny them delete/insert/update
> permissions on the query.
>
> Again I ask, why are users even seeing any queries. You should restrict the
> frontend more by allowing data interaction only through forms and reports.
> Create your own toolbars/menubars to restrict what they can do, and change
> the settings in Tools, startup so they can't get to the database window.
> Set a startup form.
>
>
> --
> Joan Wild
> Microsoft Access MVP
>
>
>

 
Reply With Quote
 
=?Utf-8?B?R29yZG9u?=
Guest
Posts: n/a
 
      12th May 2005
Paul,
Thanks, I understand the concept of its not worth it, w/o going into
details, its needed.

Yes, it is a process of making it more difficult.

Any ideas on how to set parameters for a query to turn off insert, delete,
modify and/or run code when a query result is returned to allow turning off
Ctrl-c (such as keydown event) and other keystrokes and functions is
appreciated.

Do you know how you reference a query result that is displayed? Its not a
form, report or table.

Thanks.





"Paul Overway" wrote:

> If you're really this concerned about not allowing them to copy, you should
> display a form or a report instead of a query. But realistically, if you
> have given permissions to read the data....users can do whatever they want
> with it. You might be making it a little more difficult, but they can still
> do it. Sounds like a big waste of time to me.
>
> --
> Paul Overway
> Logico Solutions
> http://www.logico-solutions.com
>
>
> "Gordon" <(E-Mail Removed)> wrote in message
> news:3811D75F-2E8F-4345-8248-(E-Mail Removed)...
> >I have blocked Ctrl-C and other keystrokes for forms and reports, How can I
> > do this for a query result that is displayed. I used the Form_KeyDown
> > event
> > on the forms, and set properties for the reports, I've even turned things
> > off
> > using the auto-keys macro. I need to allow, disallow copy dynamically
> > based
> > on user rights to the data but have not been able to find a way to set the
> > "properties" or run code associated with a query result. I also need to
> > be
> > sure users can't delete, insert or change data from a query result.
> >
> > There are querydef configs in the querydefs collection, but they are
> > relative to the query itself, the not result set and window of data
> > returned.
> > I don't even know what to call the query result screen, its not a report,
> > query, form or table.
> >
> > Help would really be appreciated.
> >
> > Gordon
> >
> > "TC" wrote:
> >
> >>
> >> Joan Wild wrote:
> >>
> >> (snip)
> >>
> >> > I don't believe you can prevent copying (and am curious how you
> >> managed to
> >> > do so in a form).
> >>
> >> Trap ctrl-c etc.!
> >>
> >> TC
> >>
> >>

>
>
>

 
Reply With Quote
 
Paul Overway
Guest
Posts: n/a
 
      12th May 2005
You control insert/update/delete at the table level with user level
security. As for preventing them from copying the results of a query....you
can't. Impossible. Hence, my previous suggestion to use a form or report
to display the results instead of a query.

As far as referencing a query that is displayed, see Screen.ActiveDatasheet.

--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


"Gordon" <(E-Mail Removed)> wrote in message
news:15A9D80A-99F5-43D1-ADEA-(E-Mail Removed)...
> Paul,
> Thanks, I understand the concept of its not worth it, w/o going into
> details, its needed.
>
> Yes, it is a process of making it more difficult.
>
> Any ideas on how to set parameters for a query to turn off insert, delete,
> modify and/or run code when a query result is returned to allow turning
> off
> Ctrl-c (such as keydown event) and other keystrokes and functions is
> appreciated.
>
> Do you know how you reference a query result that is displayed? Its not a
> form, report or table.
>
> Thanks.
>
>
>
>
>
> "Paul Overway" wrote:
>
>> If you're really this concerned about not allowing them to copy, you
>> should
>> display a form or a report instead of a query. But realistically, if you
>> have given permissions to read the data....users can do whatever they
>> want
>> with it. You might be making it a little more difficult, but they can
>> still
>> do it. Sounds like a big waste of time to me.
>>
>> --
>> Paul Overway
>> Logico Solutions
>> http://www.logico-solutions.com
>>
>>
>> "Gordon" <(E-Mail Removed)> wrote in message
>> news:3811D75F-2E8F-4345-8248-(E-Mail Removed)...
>> >I have blocked Ctrl-C and other keystrokes for forms and reports, How
>> >can I
>> > do this for a query result that is displayed. I used the Form_KeyDown
>> > event
>> > on the forms, and set properties for the reports, I've even turned
>> > things
>> > off
>> > using the auto-keys macro. I need to allow, disallow copy dynamically
>> > based
>> > on user rights to the data but have not been able to find a way to set
>> > the
>> > "properties" or run code associated with a query result. I also need
>> > to
>> > be
>> > sure users can't delete, insert or change data from a query result.
>> >
>> > There are querydef configs in the querydefs collection, but they are
>> > relative to the query itself, the not result set and window of data
>> > returned.
>> > I don't even know what to call the query result screen, its not a
>> > report,
>> > query, form or table.
>> >
>> > Help would really be appreciated.
>> >
>> > Gordon
>> >
>> > "TC" wrote:
>> >
>> >>
>> >> Joan Wild wrote:
>> >>
>> >> (snip)
>> >>
>> >> > I don't believe you can prevent copying (and am curious how you
>> >> managed to
>> >> > do so in a form).
>> >>
>> >> Trap ctrl-c etc.!
>> >>
>> >> TC
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
TC
Guest
Posts: n/a
 
      12th May 2005
Gordon, it is a little-known fact that query datsheets *do* expose
methods & properties that you can use for various purposes. The methods
& properties are similar to those of a form.

Here is what I said in a thread entitled: "If query returns no records
display messagebox", dated November 2003:

" OpenQuery seems to select the datasheet (empty or otherwise) as the
current object, although this is not doc'd anywhere (AFAICS). Thus,
screen.activedatasheet will refer to the opened datasheet. The methods
& props of that object, look very much like those of a form. In fact,
in the object browser, the datasheet object is defined "As Form" (if I
remember correctly - I don't have Access here to check). In
particular, screen.activedatasheet has a recordsetclone property,
which works exactly as expected. So you can use that property to
determine whether the opened datasheet, does or does not have any
records. "

See if the datasheet props include OnKeyPress, or somesuch. If so,
there /might/ be some way you could finagle a keypress event into the
datasheet. Not sure - cos haven't tried.

If that doesn't work, could you use an AutoKeys macro?

HTH,
TC

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make query show result if result is Null Kind regards Donatas Microsoft Access Queries 10 1st Nov 2008 11:34 AM
copy paste SQL query result to excel spreadsheet with formatting Juliet Microsoft Excel Worksheet Functions 1 1st Oct 2008 07:23 PM
Importing result from Access query to Excel but the result only c. =?Utf-8?B?RWR3aW4=?= Microsoft Excel Misc 0 16th Mar 2006 01:36 AM
copy query result to different DB suja Microsoft ADO .NET 4 27th Sep 2005 08:26 PM
copy and rename image files based on query result Maureen Microsoft Access VBA Modules 1 24th Jun 2004 09:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:09 AM.