Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table for my codes
Message
De
26/06/1997 10:14:19
Mandy Mccord
Public Interest Breakthroughs, Inc.
Albany, New York, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00037735
Message ID:
00037820
Vues:
63
>>>I had originally created a million (ok about 25) "code" tables, one for each code type, such as "computer type", "vendor" or "language". I realized it would be more efficient to combine all of these into a "allcodes" table which has 3 fields, the codetype (i.e. what category of lookup code is it?), the actual code I'd previously assigned (00123, 00124, 00125 etc.) and a description field containing the name to be displayed on the drop down boxes. I figure I can then use a combination of codetype and code for my key fields in my data tables.
>>
>>Sounds like your pretty well on target. The main thing I try to do is have a code & and description in a table. The code being the Link field that I can link to any other table as the project grows. As long as the link fields are unique you should be ok. The codes are a good idea because descriptions "can be" harder to work with when manipulating data. They can be used just to show the "Human" what the heck the code represents.
>>
>>Sounds like you on the right track. Now you can have as many code tables as you like and be able to link them to each other with no problem. The thing you want to eliminate is data redundancy. Not only does it require more work but slows a system down and requires more resources.
>>
>>HTH,
>>Tom
>
>Mandy, in addition to Tom's suggestions, you might consider making arrays from the data in the large lookup table. This is particularly useful if the users aren't adding data to the lookups. I have a similar project where all the lookup information is stored in 12 arrays which are then stored in application properties at the time the EXE loads (Public variables can also be used). These arrays are only updated/changed if someone goes in to the Lookup-editing screen.
>
>All my combos call the arrays, which are two-column arrays, code and code description, alphabetized by code description.
>
>HTH
>Barbara

Thanks for the ideas. I would like the users to be able to add to the code lists. What's the best way to do this assuming I stick with the one "allcodes" table? Should I keep another table to store the last unique i.d. for each type of code to then increment by 1?? Or just use the main "allcodes" table to sort by codetype+code then increment that code by 1?? I'm beginning to fry my brain on this project ;^).

And Paul, one of the reasons I migrated from the 25 individual tables to a single code table was that I was having trouble creating my data environment for my forms (VFP 3.0). I was getting messages telling me I couldn't add any more tables to the environment (I think I had about 20+ tables per form...to work with my page frames full of data).

Many thanks!
Mandy
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform