Per-Database, Per-User and Overall Settings

I’ve been doing some more thinking further to my previous post about changing DONATION to run not as an Administrator. In that post, I said that all of the settings that are currently stored in the Registry (in a place that can only be written by programs running as an Administrator) would move to a settings file in the new data directory for the program, which would be under the All Users Document folder, e.g. places like C:UsersPublicDocumentsCooperstock SoftwareDonation, in Windows Vista or Windows 7.

My further thinking is that there are actually 3 different levels of setting that I’d like to store:

  • Overall settings for the whole program, e.g. for things like the location of the database file and the current database filename if you are using Database -> Switch Databases.
  • Per-database settings, like which donor and donation fields to display (which may be different if you have multiple databases, perhaps one for a church, and one not for a church).  These settings will come with you if you backup the database and restore it on another computer, unlike the other two levels of settings.
  • Per-user on that computer settings, like the user’s desired location and size for the program’s main window. (I know that it will be fairly rare for multiple users to be logging in to the same computer and all using DONATION, but it’s certainly possible.)

So, my plan is to have three places to store those things – an INI settings file in the new data directory, for the overall settings; a new hidden SETTINGS table in each database for the per-database settings; and the HKEY_CURRENT_USER area in the Windows Registry (which can be written by non-Administrators!) for the per-user settings.

Does that make sense so far? I will have some detailed documentation in the program of which settings are stored at which level, for those who are really interested.

Further, I’d like to run by you which specific settings I plan to put at which levels, to see whether any of you have counter-arguments for any of them. Here’s what I’m thinking. (You will note that some of these are settings that correspond to obvious things in the program, and others are things you may not have been aware I was storing anywhere.)

Overall Settings

  • Location and name (probably just the extension, since it MUST be named donation4.something) of the current database file.
  • Other database connection properties, like whether it’s a Standalone, Network Client or Network Server install.
  • Most of the settings from Maintenance -> Email Sending Configuration, except the From Name and From Email which may vary per database.
  • The contents of the mail-merge letter and receipt templates will be consistent across all databases (though you may choose to develop separate letters for separate databases). They will be stored in a Letters directory under the new data directory.
  • The list of databases you have in Database -> Switch Databases, if you use it. (It’s currently in a file databases.txt in the DONATION installation directory. That file will move to the new data directory.)
  • Whether or not you wish to be reminded monthly to check for updates to the program, and if so, the last date on which that check was done.
  • Your registration information, if you have used Help -> Register by Email. (Yes, you might have multiple databases/organizations, but from my standpoint if you are doing that from one computer, you should only have one registration record. You can put inform me separately of your additional organization names, or I will pick that up from your license key requests.)
  • The size of mailing label you use, and print margins for them if you change those margins.
  • The last folder you stored PDF files in.
  • The current version number of the program.

Per-Database Settings

  • The three optional passwords (Program Entry, Receipting, and Limited User). These are actually already stored in each database.
  • All settings from Maintenance -> Organization Info are already stored in each database.
  • All settings from Maintenance -> Receipt Options, including the Receipt Style For (e.g. Canada, USA, Quebec etc.). Believe it or not, I actually have at least two users with one database/organization in Canada, and another in the USA, so each database has to have its own settings for this. While some receipt options (like Location Issued) are probably really overall settings, I think it will be clearer for the users to leave them all as being per-database.
  • All settings from Maintenance -> Main Window Options. Again, if you have multiple databases, the way you store the data in each, and which Donor or Donation fields you want to see etc., may vary per database.
  • The From Name and From Email settings from Maintenance -> Email Sending Configuration.
  • Memorized settings from the Letters menu windows (like which type of letter you are currently using, its filename, etc.).
  • Memorized settings from Importing windows, like Database -> Import Donors and Database ->Import Donations, for which fields to import etc.
  • The last date on which you did a database backup, and location to which you did it, plus your desired backup reminder frequency.
  • The name and email address you send email backups to, if you use that feature.
  • Whether envelope printing should include your organization address and logo. (You might have pre-printed envelopes for one organization, but not for another.)
  • There will have to be a per-database place to store any bitmap files you use for the logo and signature for receipts. (This will be tricky for me to make the receipts use them in different locations – have to think on that!)
  • The settings for One Date Batch Entry (e.g. which fields to show, and whether to include existing donations).
  • The Subject and Body of the email to which the PDF receipts are attached if you use the option to email receipts.

Per-User Settings

  • Various menu options, like the Letters menu options, prompt you to read the Help on the relevant topics when you use those options for the first time. Whether or not you have used those options for the first time will be stored per-user, since each user will use them once for the first time!
  • The size and location of various windows in the program that are resizable and movable, which the program stores. (For instance, the main window, the Batch Entry window, and the Mail Merge editor window.) Each user might have their own preference about this.

Whew, that’s a lot of settings!

As usual, if you do have any comments, please Reply to this blog post, so we can all see them. Even if you just think this is all fine, a quick reply on the blog, or just by email, would really be appreciated, so I at least know some people have thought about this with me! Thanks.

10 thoughts on “Per-Database, Per-User and Overall Settings

  1. Dan.. I think that sounds reasonable, although I am single user-single machine, so some of this makes my eyes glaze over!!

    Question.. where will the actual data be stored? (members, addresses, donations, etc.)?

    • In the database, as always – donation4.db if you only have one database. But the database will be moved from C:Program FilesDonationData to the new data directory I referred to above, e.g. places like C:UsersPublicDocumentsCooperstock SoftwareDonation in Windows Vista or 7.

  2. Dan,

    OK.. but I still don’t see it above.. I see that the location of the database will be in overall settings don’t see where the actual database will be. Sorry to be dense.

    Your response cleared it up, however.


    • I wasn’t claiming that I had said in the original post where the database would be. (I may have mentioned it in the previous post on stopping running DONATION as an administrator, though.) Anyways, glad we are both clear now!

      Having the location of the database be in the INI file in that data directory does mean that users can move it if they want, though I will probably not document how to do that, and will discourage it if asked, because it causes support headaches. (Currently you can do that by editing the ODBC data source DONATION_FB, and a few users do that.)

  3. Dan,

    You seem to have reached a good requirements compromise by using the three different settings locations depending on a particular feature’s function.
    How do you currently associate the signatur.bmp and logo.bmp files in the standard receipt format if you need different signatures and logos for each database?


    • Thanks, John. Currently the built-in receipts assume that the logo and bitmap files are in the same directory the program is installed in (normally C:Program FilesDonation), though they are coded with no pathname component (e.g. just “logo.bmp” and “signatur.bmp”) so that works whatever directory you choose to install DONATION in.

      On the other hand, the mail-merge receipts hard-code the directory name C:Program FilesDonation in with the bitmap filenames for the logo and signature.

      I think I can code the built-in receipts to be modified at runtime each time they are used, fairly easily.

      With the mail-merge receipts, I think what I will do is after the program opens the HTML template file, I will have it do a search and replace for “C:Program FilesDonationlogo.bmp” and “C:Program FilesDonationsignatur.bmp”, replacing the directory part with the appropriate place on the user’s computer, and save it back if that needed to be replaced.

  4. So you would put the signatur and logo files in different folders or give them unique names depending on the Dbase extension?

    • Actually, you are right, this is a problem. Yes, it would have to be one of the above. BUT, I’m not sure how to make this work right for the mail-merge receipts, since the same templates would be used for all of your databases, when you have more than one, but the logos have to be different. I’m sure I will figure something out.

      Perhaps a new merge code for the database extension, like <>, could be used as part of the image filename or pathname, for the logo and signature. That would work fine for the merged receipts (where the merge codes have been filled in with their correct values), but would not work when editing the template receipt itself – you wouldn’t see the logo or signature displayed. Again, will have to think about it.

      Another possibility is to have a way to store the logo and signature bitmaps right in each database. (The actual complete bitmap file, not just the filename.) Then, when you switch to that database, those files would be extracted and saved in one standard place (common for all databases). Then the mail merge templates could all refer to them in that standard place, and everything would work. (Also, having that option to store them in the database, probably with a File Open dialog to select them, would save users having to move them to the right folder themselves, and would also mean they didn’t even have to use my standardized names.)

  5. A correction: In my original post, I said that “The last date on which you did a database backup, and location to which you did it, plus your desired backup reminder frequency” would be stored per-database, in the database.

    Having thought about this, it should be stored per-database, but NOT in the database. That’s because, for instance, if you backup from one computer, and restore to another computer, your desired backup directory may be different on that other computer. And you don’t want that restore to reset the last backup date on the other computer either.

    So, there will be another new INI file, one per database, in the new data folder, to store these sort of settings, that are per-database, but shouldn’t be stored in the database or restored when you restore a backup.

  6. Another change: All settings from Maintenance -> Email Sending Configuration will be overall settings for that computer.

    I had said originally that the From Name and Email address would be an exception to that, and instead be per-database. My thought was that arguably you could want email receipts etc. for each DB/organization to come from a different name. But first of all, I think if the same person is doing it on the same computer, they are likely to want emails to come from the same person. Plus, there are technical reasons for keeping all of those settings in the same place (which would be a bit tricky to explain). And, it will be less confusing for users if all settings on one window are stored at the same level.

Comments are closed.