Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Kevin
  Where is Kevin?
 edwardsville
 Illinois - United States
 Kevin
 To: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 Tags
Subject: RE: Table setup
Thread ID: 118706 Message ID: 154866 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Visual Basic
Date: Thursday, December 20, 2007 7:56:14 AM         
   


> > I have a application that I have written
> > After reading Kens thread about Primary key
> > I was wondering if there was a better way to go.
> >
> > My app has a model table with all the info about the models
> > Then option table with all the options with info about options.
> > There are 5 different companies with anywhere from 20 to 120 models.
> > Then there are 20-200 options for each model. Many of the options are duplicates
> > From model to model. So currently there are dup options for models.
> > For instance a widget might be in the table 100 times with different models in the model
> > Field For the option
> >
> > Any thoughts?
>
> It sounds like you need three tables. A Models table with an autoinc record ID as the primary key, an Options, again with an autoinc record ID as the primary key, and a third table that matches model to option. This third table would consist of three fields. An autoinc primary key field, a foreign key to the Models table and another foreign key to the options table. The information about the model is stored once. The information about the option is stored once. In the third table you would have between 20 - 200 records for each of 20 to 200 products. Total table size: 3 four byte fields and a maximum of 200 X 200 = 40,000 records - quite small actually.
>
> Ken
> You shall know the truth - and the truth shall set you free. (John 8:33)

Ken it has been a while since you helped me with this concept.
If I implemented this 3 table system what I would like to do is have a grid
with all the options listed in one column then a column for each model with a check mark in that column so the customer can just go through and place a check in the column for the model that would have that option

any ideas how to create the grid

ENTIRE THREAD

Table setup Posted by krbaugh baugh @ 1/16/2007 11:41:24 PM
RE: Table setup Posted by Ken Murphy @ 1/17/2007 4:44:37 AM
RE: Table setup Posted by krbaugh baugh @ 1/17/2007 5:20:06 AM
RE: Table setup Posted by Ken Murphy @ 1/17/2007 1:35:18 PM
RE: Table setup Posted by krbaugh baugh @ 1/17/2007 4:15:33 PM
RE: Table setup Posted by Ken Murphy @ 1/17/2007 5:55:13 PM
RE: Table setup Posted by Kevin @ 12/20/2007 7:56:14 AM
RE: Table setup Posted by Ken Murphy @ 12/20/2007 2:01:49 PM
RE: Table setup Posted by Kevin @ 12/20/2007 3:34:16 PM
RE: Table setup Posted by Ken Murphy @ 12/20/2007 3:53:09 PM
RE: Table setup Posted by Kevin @ 12/20/2007 7:23:00 PM
RE: Table setup Posted by Ken Murphy @ 12/20/2007 8:31:13 PM
RE: Table setup Posted by Kevin @ 12/21/2007 7:18:26 AM
RE: Table setup Posted by Ken Murphy @ 12/21/2007 1:50:29 PM
RE: Table setup Posted by Kevin @ 12/21/2007 11:57:03 PM
RE: Table setup Posted by Ken Murphy @ 12/22/2007 2:32:13 AM
RE: Table setup Posted by Kevin @ 12/22/2007 5:02:58 PM
RE: Table setup Posted by Ken Murphy @ 12/22/2007 10:13:22 PM
RE: Table setup Posted by Andy Kramek @ 1/17/2007 12:38:25 PM