Results 1 to 11 of 11
  1. #1
    mr steev is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Location
    UAE-Ajman
    Posts
    10

    Make read-only checkbox is not available

    I have an Access database and I want to make it read-only
    Is there a way to make it read-only with the inability to view the read-only attribute?




    Best Regard

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    You can open a db with a command line switch so that it is read only, but I suspect that is insufficient for you.
    You can also right click on the file and set the read only property. Setting folder permissions won't work because users need to create and delete lccdb files, otherwise you will have issues.
    I know of no other way and IIRC, you cannot relink tables in a RO database, so there might be other things you cannot do. You probably should take another approach, such as opening forms with snapshot recordsets or locking or disabling all controls.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    mr steev is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Location
    UAE-Ajman
    Posts
    10
    What I mean? I want code that selects read-only from the properties of a file and then hides or deactivates the checkbox so that the user cannot return it

    Clarification
    I have code to control the properties of a database file to make it read-only, hidden or otherwise
    Code:
    
    Dim MyPath As String
    MyPath = CurrentProject.Path & "\MyDB.accdb"
    SetAttr (MyPath), vbReadOnly
    What I want?


    Hide or deactivate a read-only attribute from the database file properties (I don't want the user to change the read-only check box)
    Last edited by mr steev; 08-17-2019 at 01:56 AM.

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Seems you already have code that works for setting the property and I'm guessing you have a checkbox somewhere that allows the property to be altered. Notwithstanding the fact that if altered, the db has to be restarted for the change to take effect, hide the checkbox from the "normal" user but not yourself. For that you need a table of users so that you can control their access to things by way of their profile or user level permissions stored in that table.

  5. #5
    mr steev is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Location
    UAE-Ajman
    Posts
    10
    Sorry...
    No
    I want the vba code to prevent changing the file attribute in Windows when I right-click on the file and choose Properties ..
    Then, the user cannot change a readonly attribute that is either inactive or locked and cannot be changed

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    I don't see the point of what you're asking. Even if you can alter the property in code there's nothing to stop anyone from altering it in Windows. Trying to control read only in this manner is pointless. I can only reiterate what I've already said. User table with permissions/levels and code to control access.

  7. #7
    mr steev is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Location
    UAE-Ajman
    Posts
    10
    My friend I know that the file can be restored to write and read by the command prompt in Windows But I still want code to disable the read-only option for the database from Windows..
    is that possible? Please

  8. #8
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    I suspect it's possible to alter this via File Scripting code but it's not something I would ever bother with. My position is that it's so easy to circumvent that it seems pointless. I can only recommend that you research File Scripting Object. Sorry.
    Maybe someone else will chime in with some code.

  9. #9
    mr steev is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Location
    UAE-Ajman
    Posts
    10
    Yes, please If someone helps us

  10. #10
    mr steev is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Location
    UAE-Ajman
    Posts
    10

  11. #11
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I can only reiterate what micron has said. What you're trying to do is a pointless exercise.

    I have an Access database and I want to make it read-only
    Is there a way to make it read-only with the inability to view the read-only attribute?


    this was your original request.
    You can't prevent users from removing/changing the read only attribute unless you rely on your network security.

    Trying to do this in access is not the appropriate place to try and prevent a generic user from changing file attributes in a folder they otherwise have read/write permissions.



Please reply to this thread with any new information or opinions.

Similar Threads

  1. Make Record Read-Only After Update
    By didiomm in forum Programming
    Replies: 5
    Last Post: 09-01-2016, 10:19 AM
  2. Make subreport read only on a form
    By BRZ-Ryan in forum Forms
    Replies: 2
    Last Post: 12-09-2013, 03:15 PM
  3. How do I make my .accdb database 'Read Only'
    By TongaJim in forum Database Design
    Replies: 9
    Last Post: 02-09-2013, 06:18 PM
  4. Best way to make a query read only?
    By Remster in forum Queries
    Replies: 4
    Last Post: 12-17-2010, 04:36 AM
  5. Replies: 2
    Last Post: 10-19-2006, 04:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums