Prevent Deletions w/i Database

A

Aurora

I am using Access 2000

I made a Db program for non-Access users to use. But
someone figured out that you can delete the record. So I
set the form for no deletions. But that does not take
care of the table deletions. How can I prevent anyone
from deleting rows from the Db table???

Please help - Aurora
 
T

Tim Ferguson

How can I prevent anyone
from deleting rows from the Db table???

Depends on the sophistication of your users:-

Very naive -- hide the database window and don't put navigation buttons
on your forms

Pretty basic -- hide the main menus too. Remember to give yourself a back
door to switch them on with.

Pretty able -- use full Access user-level security. Remove all
permissions from your users except for what they actually need to see or
write.

Power users -- move to SQL server... <g> There are tools (reportedly)
that can crack fully enabled Access security so if you are faced with a
determined attack you'll just have to move up to industrial strength.

Hope that helps


Tim F
 
S

Scott M

A slightly more elegant solution is to lock out all functions. You need to
give yourself a backdoor, however, like a password.
Use the following function:
Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function

with calls that look like this:
Const DB_Boolean As Long = 1
ChangeProperty "AllowBypassKey", DB_Boolean, True

So, how you do this is to create a backup of your database. Add a form
called, perhaps, security. This form has two buttons. Lock (which simply
calls the above function with "false" instead of "true"), and unlock. The
form has a text box in which you enter a password. When you press
the "Unlock" key, the code checks that Forms![form name]!text[box#]="your
password".

When the file is 'locked', it is impossible to access menus and structure.
That is why you
need a backdoor (and why you made the copy before doing this). When it is
unlocked,
the next time it is opened you can manipulate it. Be smart and implement
the 'unlock'
code before the 'lock' code.

Scott
 
A

Aurora

Tim:
THANK YOU for your quick reply. How do I do the "Very
Naive" and the "Pretty Basic" items? Also, I have wanted
to give users only access to certain areas, using
passwords, but did not know how to do this. Can you point
me in the right direction? Do you know of an article or
something else I can read to find this out? I do not know
how to program. Can this be done without programming
language?

Aurora
 
S

Scott M

How to hide a table:
1. Right click on the table and check the 'hidden' box
2. Now you need to remove hidden objects from view.
Go to Tools|Options and select the View tab. Uncheck the "Hidden Objects"
box on the right.
3. Being able to see the tables is just a matter of checking the Hidden
Objects box again.

How to hide menus the easy way:
1. Tools|Startup and uncheck the boxes you don't want visible, like
tool bars and menus.
2. In order for this to work you probably need to give it a form to
launch on startup. Most
times you have a 'master switchboard' so use that one.
3. The 'backdoor' for this method is to simply hold down the 'shift'
key when opening the db.

BTW, programming the things I mentioned is really much easier than you
think. You can do almost
all of it with just your mouse. (copy, paste, click click kind of stuff)

Scott
 
T

Tim Ferguson

THANK YOU for your quick reply. How do I do the "Very
Naive" and the "Pretty Basic" items?

Scott has given you some methods for hiding the database window, or the
objects within it. You can pick the options in the Tools | Startup
dialog, and read the appropriate help pages too.
Also, I have wanted
to give users only access to certain areas, using
passwords, but did not know how to do this.

There is no simple way to do this. It's either a bunch of VBA
programming, (and even then, pretty easy to circumvent) or getting
properly into Access security.

As an alternative approach, you might try getting your users to behave
themselves with regard to the database itself. Explain that the thing
really does need all those tables and records, and if they bugger it up
then they are going to crash their own work. There may be a case for
obstinate and wilful fiddling being made a disciplinary matter. They are
not allowed to attack the hardware with a screwdriver and there is no
reason to adopt a more permissive attitude toward software. Someone who
is going to go out of his or her way to mess up a work database is always
going to be a liability in one way or another.

B Wishes


Tim F
 
A

Aurora

Scott:

Thank you for responding. But are you talking about
Access 2000. I highlighted the table, and right clicked
my mouse but there was no "hidden" box listed.

I am using Access 2000 - Is there a different way to get
to the hidden box?

Aurora
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top