Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Nov 2009
    Location
    PA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi...Is there a way to simply restrict certain users from tables/queries using VB code? I don't want to use ms Access's built-in security through the WorkGroup Administrator program.....Thanks!

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    If you allow users access to the Database Window so they can see the tables and queries, then you can't stop them using them.

    If you want to restrict what users can have access to (without using built-in security) you need to build an interface so that all interaction with the data takes place via forms (and reports).
    Then you can use code to hide the things you don't want them to use, or display messages saying they are not allowed to do this or that.
    Regards
    John



  3. #3
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Hi...Is there a way to simply restrict ?
    I think the WORD here is SIMPLY
    In which case the answer is NO!
    It can be done, but it will involve quite a bit of work and programming as John says.


    Andrew

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I can suggest one relatively simple way to do this with no code.
    • First split the db (if it is not already split). This involves separating the tables into a separate file. A split db has a data file containing just the tables (typically called the Backend) and a Front end file that contains everything else (queries, forms, reports, macros, code) The Front End uses the tables from the Backend as Linked Tables. Why Split a database is a tutorial on splitting by moderator WendellB.
    • With a split db, it is usual for each user to have a local copy of the front end. These all access a shared Backend kept on the server.
    • The trick in your case is to have two versions of the Front End. One version containing everything, and a second reduced version that does not link to all the tables, and contains only the queries you want those users to have access to. You just need to be careful that this reduced version is internally consistent. i.e. you don't want to have queries there that use tables you have not included etc.
    • The downside of this is Maintenance. You now have two versions to maintain. When you make changes in your Front End, some of them need to be copied across to the reduced Front End as well. How much of an issue this is, depends on how much development is taking place, and how much of it needs to be distributed.
    Regards
    John



  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    Im not sure i understand John.
    Whcih FE does the user have? if they have the reduced FE how can the queries work if they dont point to the tables in the backend?

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Patt

    I interpret this question as suggesting there are two (or perhaps) more groups of users.
    Some get the full Front End that has all the queries, and links to all the tables.

    Others get a more limited Front End, that contains just some of the queries, and links to any tables needed by those queries, and perhaps links to other tables if Will wants them to have access to those tables.

    As I said before:
    You just need to be careful that this reduced version is internally consistent. i.e. you don't want to have queries there that use tables you have not included etc.
    Regards
    John



  7. #7
    New Lounger
    Join Date
    Nov 2009
    Location
    PA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks everyone for your suggestions!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •