How to store Misc. Info within a database

S

SrMousse

I have a handful of misc. data that is unique an really doesn't fit
anywhere... I need it to be easily updateable, as it will and needs to
change from time to time, What should I do with it?

Some of the data is a "Common Footer" that prints on ALL reports and DOES
change periodically. I decided to create a common footer table with a single
value and can access it from all of my reports... it works great!

However, I now have a bunch of other misc. data that I need to store, like
the "Working Year" (I am going to use the field to dictate which year of info
to pull the data from) "Common Header", etc. Additionally, I am considering
storing formatting data such as font size (still considering this).

So with all this explained, to sum it all up, what is the best method for
handling all of this misc. data? I didn't think creating a separate table
for each piece was the best idea.

Thanks for your suggestions!
 
B

Brendan Reynolds

I use a single table with two text fields, 'OptionName' (indexed, no
duplicates) and 'OptionValue'. I can retrieve any value with a simple query
....

SELECT OptionValue FROM Options WHERE OptionName = 'Whatever'

.... where 'Whatever' is the name of the specific option I'm looking for.

This does mean that I have to store all option values as text, and convert
as necessary ...

strValueAsString = rst.Fields("OptionValue")
boolValueAsBoolean = CBool(strValueAsString)

.... but that's no big deal.
 
T

Tim Ferguson

However, I now have a bunch of other misc. data that I need to store,
like the "Working Year" (I am going to use the field to dictate which
year of info to pull the data from) "Common Header", etc.
Additionally, I am considering storing formatting data such as font
size (still considering this).

I use the database properties for these, because for me they're attributes
of the application rather than core data.

If they need to be invisible, use the DAO.Database.Properties collection.

If you want them to be user-accessible, use DAO.Database.Containers
("Databases").Documents("UserDefined").Properties because these are the
ones that appear on the File | Properties dialog. (I think -- you need to
check the help files for the exact access path.

Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top