I'm using access to organize some doc files over a network, however I want the msaccess root folder limited to read-only access and use a hidden folder with full control for the doc files that I maintain.
I'm running the database through the read-only folder and I need to somehow make access establish a different network login when accessing the doc folder.
Is there some vba code that can help me automate the hidden logon?
You want the user to be able to log in, start the Access App and using Access, pull a file out of the controlled documents folder, but not be able to get to the controlled documents folder directly.
As far as I know, you can not change your login (and therefore current user network rights) during a Windows session. You could do that with Novell, but few people use Novell these days. Windows requires you to log off and then log back on, which is the same as a shut down to any running applications.
With some fancy coding, you can create a document list and allow the user to select a file. Then, copy the file to the user's temp directory before openeing it. This prevents the user from seeing where the documents actually come from.
FYI: If a folder is HIDDEN, Access will not be able to see it or work with it.
Yup, that's exactly what I'm doing, but I really need to create that hidden logon to almost absolutely bar these tweaky users from hacking into the doc files.
Right now, the database shows a title for each doc and when they select a document I've implementing a download procedure that copies the file into their local folders for editing. Vice versa I have an upload procedure that submits the final revised doc to the server.
The problem is that I'm forced to give them 'modify' permissions to the server's docs folder (specially during this upload operation) which I have to maintain the integrity of.
Right now, when they connect to the server to use the database, they get the modify permission right away. Of course what I want to implement is
a separate folder for the database which gives them read only permission and then during upload operation, log them onto the account that gives them
modify permissions (programmatically) so that they absolutely have no idea of what just happened.
this is like the rate determining factor of this project. I'm just so...
Well, you won't be able to do that in Access without some serious Windows API manipulation.
I have an alternate method I've used. I decode the documents to raw binary and actually store it the documents in the DB as an OLE object. It's very efficient - 1 byte file size = 1 byte DB storage consumed and it is fast.
When a user needs to modify, I recreate the file in the user's temp directory and open it in the native application (Word, for example). When the user is done editing, I log the change and suck the file back into the DB. I can either overwrite, or in my case, save the new version as a new record (preserving the previous versions).
The use has no chance of getting at the original source file because the original source file doesn't exist.
Good luck in your adventures - let us know how you've approached the problem when you get something that works - perhaps we can discuss rpos and cons of our methods.