Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table accessibility

Status
Not open for further replies.

villsthearcher

Technical User
Oct 20, 2005
27
US
Hi,

I intend to make my database a read only file. What I mean is that the User will not be able to change the Design or modify the forms, reports or queries respectively.

So what I did was I first converted the .mdb file into .mde file. Then I replicated this file. Now, I was successful in doing this and I got what I wanted. But I found that, I was still able to add data to the tables. How do I or what should I do to turn off this ablity to enter data into a replicated file of a mde file.

Thanks,
villsthearcher
 
All forms should have Allow Edits, Deletions, Additions to No

At StartUp otpions define your start up form (switchboard) and unselect Display database window, Use special access keys, Allow Toolbar/Menu Changes.

This piece of code when run will create the AllowBypassKey property (pressing Shift key at startup) and disable it

Code:
Dim dbs As Object
Dim prp As Object
Dim AllowBypassKey As Boolean

    Set dbs = Application.CurrentDb
    Set prp = dbs.CreateProperty("AllowBypassKey", 1, True, True)
    dbs.Properties.Append prp
    'Next lines declare the start up form
    'Set prp = dbs.CreateProperty("StartupForm", 10, "StartUp", True)
    'dbs.Properties.Append prp

    Set dbs = Nothing
    Set prp = Nothing
so that the user only sees your start up form. This enables it back
Code:
Application.CurrentDb.Properties("AllowBypassKey") = True
and clears the start up declaration
Code:
Application.CurrentDb.Properties.Delete "StartUpForm"

But any one who knows how to open a connection to your database could play with your data. The best would be to create user level security, create a users group with permissions set to read only on tabels. Plus any other on the rest of the database objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top