Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2002

    Unanswered: template database

    Hi everyone,

    In the past I made several access databases. I usually create them in the same way, meaning :
    - first displaying splashscreen where companydata (name, address, ...) and applicationdata (applicationname, version) is retrieved from a table
    - second displaying mainmenu

    Till now I created all databases from scratch (except for copying some forms and importing some modules)

    Now I want to create a template database which I can copy all over again. Just by modifying some parameters in a table I can customize the database.

    I was thinking of creating parameter-tables where I can define :
    - which references or modules need to be loaded on startup
    - if splashscreen needs to be shown
    - if menubar is needed
    - if security, logon is needed
    - etc

    Does anyone know if such framework already exists?
    Does anyone have some samples which are interesting to be included?
    Does anyone have any good ideas, tips, ...

    Thanks in advance

  2. #2
    Join Date
    Jan 2007
    Provided Answers: 10
    I believe all non-form modules are loaded on startup.

    I am going to go ahead and say that this aint a great idea. Sure, create a template to store all of this stuff; but don't bog down a project with code, data and objects that are not going to get used.

    Instead, when you create a new project, import only the items needed from your "template" and start from there.
    Home | Blog

  3. #3
    Join Date
    Nov 2002
    It is not my intention to overload my project with unneeded objects.

    For example : I was thinking of a centralised folder where I can store dll-files and bas-files.
    When I need to create a new database, I wil make a copy of my templateDB. In this template there are tables where I can select which references or modules I need. They will be loaded at startup from the centralised folder.

    Concerning modules I was also thinking of a way to import newer versions.
    Suppose I made 5 databases and suddenly it seems there is an error in one of the modules. At this moment I should correct this module in all databases one by one. Suppose, when starting the application, I could do a check (based on date for example) to see if a newer version of this module is available (as bas-file). And if there is a newer version I could import it automatically. This means I don't have to take care of it anymore.

    Same with references. If I could check in a table which references need to be loaded and if they're located on a central location, I don't have to be worried about broken references anymore.

    Suppose I need to create a database with confidential data in it, so I need some kind of security. Wouldn't it be easy if I just could mark a checkbox and based on the value of it, an additional module will be loaded, as well as a form which will provide the possibility to manage users and groups.

    Same with splashscreen. By checking this option and entering the location of a DB where company-info is stored, the application will start, load required modules, read company-info from DB and shows this info in splashscreen.

    I have to admit I created just a few databases in my life, so I'm not a specialist at all. But I noticed I could reuse some components by copying them into the new DB. But copying is just copying, so I was wondering if there is a possibility to automate all this based on parameters. I might be dreaming, but at least I would appreciate some feedback, tips, samples to see what is possible.


  4. #4
    Join Date
    Dec 2004
    Madison, WI
    I did something similar to this with the Energy company I worked for but not to the extreme of dll, bas, reference, versioning checking (which I have to agree with georgev on bogging down a project with unneeded modules to do this.) Plus, these "templates" that I created were specifically made for the Energy company and the type of work they did. But regarding centralizing things - YES. You should always centralize things when possible. Code to check other code type stuff though or code to load other coding modules...(I'm not a big fan of this philosophy.)

    For my example, I had a "template" unbound form customer mdb which had all the modules, functions, etc..that I needed. I then used that template to construct the different energy star programs around (since the customer database was centralized and each energy star program was "modulized" to take into account that each one tracked different things.) Then I also had an "import" template for importing files and an "export" template, a "report" template, a "security" template which had the security forms, etc...
    When I then constructed a new energy star program, I put the pieces together on what I needed, importing items from the other "templates".
    "BUT" - this all geared around energy star programs and the Energy company. The customer template that I had designed for the Energy company could not be used "as is" for any other business and although I could use ideas from that template, I would need to re-do most of the stuff if I were to use that template for another company which in essence would take more time modifying versus if I started a new customer interface from scratch for that company. Although an "import" type template and some of the other templates can more easily be tweaked from a somewhat standardized template which I'd import and then tweak.

    I've personally devoted most of my time collecting what I call "snippets" of code which do certain things and then if I need to do something, I import that snippet and minorly tweak it to work for the purpose intended. The snippet might be a module, collection of modules, or a specific function to do a specific task. An example is the "GetUser" snippet (in the code bank), where I'll utilize that piece of code in the construction of a new mdb to get the users loginID (which entails a module and a function). After many years of collecting stuff like this, I usually find myself taking a piece of code from one application, another piece from a different application, importing modules from another application, a form that I liked from another, build a new application.

    Things like a splashscreen and other forms though you'll find will always change as you eventually get sick of using the same splashscreen or form in each mdb and end up finding the desire to design a "new look" with each new mdb (or due to the requirements of the new mdb). Having a collection of a dozen different splashscreens or a dozen different report type forms you can choose from is something to consider verses trying to stick with the same type of form which probably will need modifying and look different in your next application.

    Keep in mind that any templates you design for the company you're currently working for, will most likely need to be revised for another company you may eventually work to the point that you may wonder if it wouldn't have been easier to start from scratch and just import the necessary pieces of what I call coding "snippets." By the way, there is a coding snippet to check for the current references. Again though, as georgev pointed out, would I have this snippet in every application I designed? - probably not as there are dozens and dozens of snippets which would be nice things to have in every application but I'd rather not bog down that application with every one of them and have to troubleshoot putting them all in one kettle.

    Crude...I got long-winded again...sorry about that. Thanks for bearing with me and I hope this helps.

    Anyway, as far as samples go, take a gander at the code bank in this forum. There's plenty of examples to look at which will keep you occupied for many, many hours.
    Last edited by pkstormy; 04-25-08 at 14:43.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts