Results 1 to 6 of 6
  1. #1
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127

    Vba Make a folder and its contents Invisible

    I am trying to Hide some files in a folder. I have tried this SetAttr "c:\temp\Sample.txt", vbHidden. But any one can right click and change the property. and the files are not completely hidden. The image is dull but its still partly visible. Hope you guys get the point. Does any one have any ideas to accomplish this. Completely Hide files or folders and contents from the computer and again make vba show them.
    Thanks



    MOD EDIT: topic discussed in https://www.accessforums.net/program...des-43230.html

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Hiding files is usually set up through your control panel/explorer options not through VBA code. What is your goal here? to hide files from your users? what are you doing with the files? are you opening them/linking them into MS access? In other words what is the relation between these files and your Access database that you need to hide them?

  3. #3
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    The files in a folder in the current project path. The file paths are in the tables. I was trying to hide the folder and its contents after I close the database. I can't delete them cause I don't want to keep them attached to a table cause the database would grow too much in size
    thanks

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Sorry I have no idea what you're trying to say.

    If you are storing a path in your table name instead of the document itself (which is a good idea) you don't have to use the currentproject.path to retrieve that document, you can recall the path from, let's say, a hidden table within your database so the users don't know the actual location of the files. Though frankly, I don't see the point, let's say someone opens a file through your database, then they make some alteration they are not supposed to and click save, it will still save over your existing file.

    A better option may be to store your 'permanent' files in a safe location (one where they do not have edit permission) then, if they want to open a document, copy that file from the safe location to a different folder (currentproject.path if you're married to that idea), then they can open it, make changes, do whatever, and when they close the database you can either clean up any non database related files by deleting them or saving those 'updated' files back to your permanent storage if necessary.

  5. #5
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Hi rpeare Thanks for the Idea. I gues what I want is not possible. That is to create a safe folder in windows which no user or the current user can access or view without password.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    A MS Access user's network permissions determine what they can and can't see, not MS Access itself. If you want to create/change permissions on a folder with vba (haven't ever tried to do it myself) would require administrator level access on your server, and if a user has administrator rights they'd be able to see hidden/protected files anyway.

    Any file manipulation you do in VBA is likely going to use filesystemobject commands. If you want to peruse those commands (for instance fileattributes = 2 is a hidden file) feel free but realistically you are bound by the user's permissions, they will not be able to create folders/files if they do not have permission to the root folder.

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

Similar Threads

  1. Exporting by unique values, and name/folder by cell contents
    By dakpluto in forum Import/Export Data
    Replies: 7
    Last Post: 02-18-2014, 11:48 AM
  2. Replies: 6
    Last Post: 08-22-2013, 05:35 AM
  3. How to make a field invisible in form view?
    By snowboarder234 in forum Forms
    Replies: 3
    Last Post: 10-25-2012, 12:43 PM
  4. Make result invisible in Form?
    By RachelBedi in forum Forms
    Replies: 1
    Last Post: 10-23-2012, 09:12 AM
  5. open folder/Make new folder(example)-VBA Code
    By Madmax in forum Code Repository
    Replies: 3
    Last Post: 03-13-2012, 09:17 AM

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