Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where's my relationship ??
Message
 
 
To
12/12/2001 03:42:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00593120
Message ID:
00593666
Views:
20
>>>I have two tables.
>>>An article-table and an catagory-table.
>>>The article table has an primary key on his articlecode and a regular on the category-id.
>>>The category-table has an primary key on his id.
>>>In the forms dataenvironment I see there's a relationship bewteen them,
>>>but when I'm running the form and moving to the next record of the article table, the category table stays at the same record.
>>>What am I doing wrong ?!?! :-(
>>First, see to it that the child is the category and the parent is the article table. Second, the width of the key fields should be the same.
>
>There is no child or parent, each article has an category with settings specefic for that category (rates,...).
>A category can be assigned to multiple articles.
>If I go to an article I want to see the category's rating and use this to calculate his price.
>
>I think my problem is I made the wrong indexes.
>Article-table -->PK ->article-code
> Regular ->category-code
>
>category-table -->PK ->category-code
>
>Are this the right indexes ??

The equivalent code should be like this:
Use Article In 0 
Use Category Order categorycode

Select Article
Set Order To categorycode Into Category
PK has nothing to do with establishing parent-child relationship in your program. I mean, when it comes to relating tables it does not follow if PK or REGULAR. PK is for referential integrity (Cascading updates, Deletes, ensuring Key Uniqueness) and persistent relationships. Based on your list of tables and indexes, the articlecode of the article table has nothing to do in establishing the relationship.
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Previous
Reply
Map
View

Click here to load this message in the networking platform