tags:

views:

56

answers:

5

David Fenton recently mentioned in another thread that

"The only proper place for any Access app (since Windows 2000, in fact) is the folder the %AppData% environment variable points to."

I greatly respect David's knowledge, especially in all matters relating to Access, but I'm confused by this statement.

What is the advantage of following this advice, especially in an environment where you are going to have multiple people using the same computer to access your app?

Won't installing to this folder only install the app for one user? And if this is true, won't installing your app multiple times leave multiple, separate copies of your app on the machine? Hard drive space is cheap these days, but I still don't want a front end file and other supporting files (graphics, Word and Excel templates, etc.) copied multiple times onto a machine when one copy will do.

What are your thoughts? Am I missing something key to understanding David's advice?

A: 

You're running into a bit of an issue here, because you're thinking about the environment variable name %appdata%. That variable stores the directory returned by SHGetSpecialFolderPath(CSIDL_APPDATA).

What you're looking for is the directory returned by SHGetSpecialFolderPath(CSIDL_COMMON_APPDATA). There's no environment variable for that directory. This directory is (as the name indicates) common to all users.

The advantage of David's method is that the Access data is protected by NTFS access rights, when it's in CSIDL_APPDATA. A user can only delete his copy. In CSIDL_COMMON_APPDATA, anyone can delete the single shared copy.

MSalters
There have also been problems reported with CSIDL_COMMON_APPDATA in Vista/Win7, in that it's been reported that the folder it returns is read-only for user-level logons (i.e., the security token you're running with under UAC). I haven't experienced this myself, but I'm not at all concerned about the issue of multiple copies of the front end, so I have no problem putting it in the user profile.
David-W-Fenton
I just double checked and regular users aren't allowed to view let alone update the Common App Data folder. David, that was very likely me reporting problems with the Auto FE Updater not being able to create shortcuts in the common desktop in Windows Vista and newer.
Tony Toews
It wasn't you, Tony -- it was someone else.
David-W-Fenton
A: 

It's probably always best to put these advice and tips into perspective. The assumption being made here is if your application is going to be utilized in a multi user mode (that means more than one user in the application of the same time), then it's pretty much assumed that your applications going to be split into two parts. The so called application part (front end), and then the data file only part, or so called backend part.

So, you have a FE and a BE.

In this environment, each individual user within your office will have their own copy of the application placed on their workstation. The BE (data file) is thus assumed to be placed on some share folder on a server.

In the case we're not going to have multiple users running this application, or the application is not really under development, then you really don't need to split your application into two parts. However if you split your application, it means all of your users can safely work and utilize your application while you work on a copy of the next great version of this application release. Without a split environment, you really can't have any workable development cycle.

It is a long time and honored suggestion that if you're going to use access in a multi user environments, each individual user must have a copy of the front end application placed on each individual computer. If you avoid this suggestion, the end result is instability in the general operation of your application.

I have an article here that explains on a conceptual level and doesn't just tell you two split your application, but explains well why you should split your application:

http://www.members.shaw.ca/AlbertKallal/Articles/split/index.htm

Albert D. Kallal
I don't think he meant multi-users, but multiple people using the same computer/different logins and each would have their own %AppData% folder.
Jeff O
Yes, I'm very aware of splitting frontend and backend. Jeff's comment is dead on.
KevenDenen
A: 

If everything is always the same for every user on a given machine, then multiple copies of a file may not be such a good idea. But when that one exception occurs, you've painted yourself into a corner. They may need a different template version for example.

You seem to be in a rare situation for an Access developer.

Jeff O
+1  A: 

First off, this is an issue only for a workstation that has multiple users logging on to it. That's pretty uncommon, isn't it?

Second, you admit there's no issue with disk space, so the only real issue is keeping the front end up-to-date, and that issue is really completely orthogonal to the question of where the front end is being stored.

That issue can be addressed by using any of a number of solutions that automatically copy a new version of the front end when the user opens it (if needed). Tony Toews's Auto FE Updater is the best solution I know of. It's quite versatile and easy to use, and Tony's constantly improving it.

So, in short, I don't think there's any issue here at all.

David-W-Fenton
Oh, if your environment users roaming profiles, it's something to think about. If you store settings in the user's copy of the front end (not advisable, in my opinion, but I've done it), with roaming profiles, that would follow them from workstation to workstation. But that also means there's more overhead in synching the profile to the server (though front ends shouldn't be all *that* big).
David-W-Fenton
This problem could also happen with Terminal Server/Citrix systems. Although there it's more likely that the users profile folder would have a copy of the FE which now means it's being backed up every night.
Tony Toews
Yes, it is somewhat uncommon, but I do have a couple databases I work with where the employees can work from any workstation in the office (and they do have separate logins, no server so no roaming profiles) so in at one of the companies, a machine could have 20+ profiles on it so 20+ copies of the front end install (around 100 MB per install). I definitely see the wisdom of your advice for most situations, I just will avoid it for these oddball companies. Thanks David and Tony.
KevenDenen
I can't see the problem with 20+ copies of the front end that wouldn't be a problem because there are 20+ *profiles* on the computer. In other words, the copies of the Access front end are the least of the issues, seems to me.
David-W-Fenton
Yes, but I don't have any control over that. I don't have anything to do with their network, just this Access application.
KevenDenen
I'm still not sure I understand what you're worrying about.
David-W-Fenton
+1  A: 

Yes, this is an issue but the only way around it is, assuming the IT admins allow it, to create a folder in the root of C drive and install the Access FE database file in that folder. That said I'd stil use the Application Data folder even if files are duplicated. As you state hard drives are cheap.

This assumes you don't mean a Terminal Server/Citrix system where users are simultaneously logged into the system.

Tony Toews
But installing in the root of C: is not different from installing in the programs folder -- in either case, you have to override default permissions, both of which are Read-Only for user-level logons (or any logon running under Vista/Win7 UAC).
David-W-Fenton
Tony Toews
Authenticated Users is a "dynamic" group, not a defined one. Someone could be a member of Authenticated User by virtue of having logged onto the domain controller and not be a member of the Users group, e.g., a domain administrator (who is usually member of the Users group, but doesn't have to be). Authenticated Users is what I use to replace the EVERYONE group (which includes non-authenticated users).
David-W-Fenton
Those permissions are weird. I'm too lazy to fire up the Win7 laptop, so won't check it myself. Are you running in domain environment or standalone PC? The Authenticated Users group works the same, only the auhenticating authority is the PC itself, instead of the domain controller. I hate putting anything in the root of C: in any case, since that's not where stuff belongs (I want the root of C: to have as few directories as possible, in fact). Microsoft has designated particular folders for user data (and the root of C: is not it), and that's where I'm going to put my user data!
David-W-Fenton