How would you design this MS Access database:

How would you design this MS Access database:

am 12.11.2007 22:43:47 von benn686

I kind of get the idea of databases, how the fields and keys work, but
Im not very sure about designing one... what should be a field,
etc. I've read that the design of the database is the most
important, so I thought Id get some inputs!

The database I wish to create will contain dozens of "Message"
types. These messages types will all have the same structure:

Each message has a 32 word "data" payload (unsigned 16 bit), and for
each of these data payloads, I would also like to associate a
Description string. Each data word can be modified from a vb
program, but initially I would like to set each of the 32 words for a
message to a default value. Finally, I would like to make sure that
there is a range check on the data itself so that it never
inadvertently gets set to something out of range.

So for example,

Message 1:
----------------
Data Payload & Default Val:
Description Range
Data word 0: 0x1234 "Header
Info" Valid (0x1200 - 0x1300)
Data word 1: 0x4445 "Mailbox
Source" Full Range
....
Data word 31: 0x8274
"Checksum" Full Range


So...

Would the database have 32 Fields Named Data 0, Data 1.. Data31? And
32 more fields for description and 32 more fields for Range? This
seems like too many fields.. perhaps,

Would the 32 words of Data be just one field?

In either case, I dont see how each description and default value will
get associated to a particular data word (0-31)?

Re: How would you design this MS Access database:

am 13.11.2007 01:47:28 von Smartin

On Nov 12, 4:43 pm, benn...@hotmail.com wrote:
> I kind of get the idea of databases, how the fields and keys work, but
> Im not very sure about designing one... what should be a field,
> etc. I've read that the design of the database is the most
> important, so I thought Id get some inputs!
>
> The database I wish to create will contain dozens of "Message"
> types. These messages types will all have the same structure:
>
> Each message has a 32 word "data" payload (unsigned 16 bit), and for
> each of these data payloads, I would also like to associate a
> Description string. Each data word can be modified from a vb
> program, but initially I would like to set each of the 32 words for a
> message to a default value. Finally, I would like to make sure that
> there is a range check on the data itself so that it never
> inadvertently gets set to something out of range.
>
> So for example,
>
> Message 1:
> ----------------
> Data Payload & Default Val:
> Description Range
> Data word 0: 0x1234 "Header
> Info" Valid (0x1200 - 0x1300)
> Data word 1: 0x4445 "Mailbox
> Source" Full Range
> ...
> Data word 31: 0x8274
> "Checksum" Full Range
>
> So...
>
> Would the database have 32 Fields Named Data 0, Data 1.. Data31? And
> 32 more fields for description and 32 more fields for Range? This
> seems like too many fields.. perhaps,
>
> Would the 32 words of Data be just one field?
>
> In either case, I dont see how each description and default value will
> get associated to a particular data word (0-31)?

I don't follow what you are trying to model, but see if this makes any
sense to you...

Rather than one table with many columns how about three tables (to
represent Data, Description, Range) with only a few columns each. One
field joins the message IDs, a second field additionally joins the
Words, and a third contains the actual data.