Print Page | Close Window

NormalizeDenormalize.mdb (intermediate)

Printed From: Roger's Access Library
Category: Roger's Access Library
Forum Name: Roger's Download Samples
Forum Description: A compendium of Microsoft Access 97 and 2000+ routines, each separated into its own sample database.
URL: www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=312
Printed Date: 22 Nov 2019 at 11:18am


Topic: NormalizeDenormalize.mdb (intermediate)
Posted By: Roger Carlson
Subject: NormalizeDenormalize.mdb (intermediate)
Date Posted: 30 Jul 2008 at 10:44pm

Please consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm - find out why here .
 

NormalizeDenormalize.mdb

There are two modules here 1) Normalize and 2) Denormalize.

"Normalize" takes the data in table2 and creates table1. It illustrates how to take a table which has fields like Value1, Value2, Value3,... and write them into a table which has one field (Value) with each of the values in a new record rather than having them all in one record. In other words, it normalizes the table. (At least that part of it.) Thus it takes non-normalized data and puts it into a normalized form.

There are 4 subs/functions. "NormalizeTable" is the main sub which calls the others. "CreateNormalizedTable" deletes table1 and then recreates it. This is not strictly necessary, but it makes it unnecessary to make sure there is an existing table. "NormalizeIt" does the normalization. It calls "NumberOfFields" which find the maximum number of fields in table2 so the FOR loop know how many times to execute.

Denormalize takes the data in table1 and creates table2. Thus it does just the opposite and denormalizes a normalized table. This also has 4 subs/functions. "DenormalizeTable" is the main sub which calls the others. "CreateDenormalizedTable" deletes and re-creates table2. It calls "MaxNumberOfFields" to decide how many fields to create. Lastly, "DenormalizeIt" does the denormalization.

To execute either, go the appropriate module, put your cursor in the first sub, and push the execute button.

Download
Access 97 (34 KB):
http://www.rogersaccesslibrary.com/forum/uploads/5/NormalizeDenormalize97.zip - uploads/5/NormalizeDenormalize97.zip
Access 2000 DAO (37 KB): http://www.rogersaccesslibrary.com/forum/uploads/5/NormalizeDenormalize2k.zip - uploads/5/NormalizeDenormalize2k.zip



-------------
Consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm" rel="nofollow - find out why here .<



Print Page | Close Window