Question Using Access as a medium to store files

accessrookie2

Registered User.
Local time
Yesterday, 18:23
Joined
Jul 23, 2009
Messages
16
Hello I'm currently working on a database where users are allowed to upload documents. The documents get transfered to a server, and the links and all that get stored in a table, here's my issue.

In order to write files to the server they have rights, I want the user to be able to delete files through access, but not if they just navigated to the server. If I block the delete right or make the folder hidden as a quick fix, access cannot delete or upload new files.

What would be the best way of going about doing this, like I said I cannot have users deleting files through explorer or the table will get all messed up.

Thanks in advance!
 
Not sure you can do this directly.

In theory, when you run utility XYZ that interacts with the file system in a domain-based or workgroup-based environment, your ability to do so depends on the way Windows identifies you to the file system. Your permissions are maximized against any access control entries (group identifiers) and permissions associated with the file AND any group identifiers associated with your account. Once that permission maximization occurs (inside the access arbitration manager), the system knows what you can do - and what you can't do.

The catch is that I'm not personally aware of a way to install a product with extra privileges or group identifiers that would "bleed through" to your session. That doesn't mean you can't, only that it is not obvious how to do that.

If you cannot install an image with extra group identifiers that participate in the session's group membership, then your apps (such as Access) run with the same permissions as any other app. And vice versa. So if Access could delete it, the DELETE program could do just as well - because they have the same user context.

Try a web search for "Windows Images with extra Group Identifiers" (and variant phrases like that) because that is the only way I know to make it work for a Joe Average User account to do something with one utility that they couldn't do with another.

Outside of that, I would say try this:

Make a list of files to be MARKED for delete - but don't delete them yet. If a file is to be deleted, add it to a table or mark the record where it is referenced or something much like that.

Search this forum if you don't already know how to do this on how to schedule a Windows Task Scheduler run of Access using the -x option to specify a macro name. Or if you don't want it automated, make it a macro that you can run. Have the macro run code that deletes files from the "Marked for delete" list. If the macro is run from the task scheduler, remember to include a QUIT step at the end of the macro. In that case, run the item as SYSTEM or at least as a username that has sufficient rights to do what you wanted to do. If you need a password to get into that username, I'm not sure how to handle that, but the forum may have some options there, too. Is there a way to specify a username and password from the command line? Look up Access command line options in the help files to answer that question.

To make it spiffier, use this approach: Add a flag in whatever record holds the original file reference, "MrkDel" or something similar, saying "This file is marked for delete" - then fix other queries that reference the files to disallow use of marked records. So it looks like the record was deleted with the file, but it is still there. Just not responding. If the user tried to see the file directly, OK, it would still be there, but Access wouldn't touch it if you marked it appropriately.

Now, your problem is simply to run your macro or code from an account that has delete access to the folder, but general users can only have create access to the folder. Which means it cannot be the folder where the database resides because of permissions needed on that folder.

By using "Mark for Delete" plus deferred deletion, you can have closer control over what is done and when it is done, including logging and such. Which is surely a good thing.
 
Thank you for the quick reply, I will look into the extra group priviledges.

As for the bottom part of your post, I want the file to be deleted immediately if they do it through access, the problem is that if someone decides to look through old files to free up space on the server or something like that, they can delete the documents through windows explorer. Then when users go back through access, they will still see the filenames, but they won't be able to open the files.

So basically I'm trying to prevent accidental deletion of the files by wanting them only to be deleted through access so it updates the table accordingly.
 
It is possible to store the files within a table in a database. I find that storing the objects as BLOBs in an SQL server works well. I would not store them in an Access database.
 
I believe we're trying to get away from storing objects in an sql database.

I don't want to store them directly in access because that would cause the database to become huge overtime. I didn't find anything that helped me about the windows images group rights. If anyone has done something like this before I'd be happy to hear how you solved this dilema (or if you just trusted that your users wouldn't delete files).
 
the problem is that if someone decides to look through old files to free up space on the server or something like that, they can delete the documents through windows explorer

This has become an operations problem. As such, you need to review your site's defined responses to specific conditions. This is often called a "procedures audit" and doesn't necessarily involve any code at all. It might relate to written instructions such as "what you do if... "

If you are concerned about this unexpected removal via Explorer, then you should have a shift operator and only your operators or sys admins should have the permissions necessary to do disk cleanup.

Sorry to say it, but you are rapidly approaching the point at which you are growing into a no-longer-small business. And as such, you need to think about making not only software transitions but also business operations transitions to medium-sized business.
 
Alright, thank you very much for your time, I will try to educate the users as best as possible to avoid this issue.
 

Users who are viewing this thread

Back
Top Bottom