ABC Blocks

ABCDataworks

Database and Website Design, Development, and Deployment--All in the Service of Your Mission

Most database applications we build have a number of values that must be accessible from anywhere in the application--directories where different files get stored, the last time a global update was done, etc. You can use constants for this purpose, but it doesn't make all that much sense to look in code to get data. The AlphaBet City way is to use a table called tblConstant. This table is in every database we build. It's only got one record, with fields named for each "constant" value we need to hold. It works quite well--it's quick enough to get data from the table, you can put it in a global variable if you're going to be using it frequently, and it's really easy to see all of the constants you have in a database, and you can change them quite easily, even through code.

To make sure there is only one record in the table, create your primary key on a numeric field with a validation rule of "=1".