Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Apple, tomato, lettuce -- hierarchical recordsets???
good day! i'm having trouble with parent-child relationship. one typical exampleis the ITEM_CATEGORY & ITEM:
ITEM_CATEGORY
- item_cat_code (primary key)
- item_cat_desc
ITEM
- item_cat_code (foreign key)
- item_code (primary key)
- item_desc
i'm using ADO recordsets (rsItem_Category & rsItem), how do i make my rsItem automatically contain the related records everytime my rsItem_Category moves to another row.
to illustrate here's a sample data:
rsItem_Category
item_cat_code item_cat_desc
FRTS FRUITS
VEGE VEGETABLES
rsItem
item_cat_code item_code item_desc
FRTS APPL APPLE
VEGE TOM TOMATO
VEGE LET LETTUCE
as i was saying, when rsItem_Category is in the second record (item_cat_code = 'VEGE'), rsItem should have these records (item_code = 'TOM', item_code = 'LET').
when i was programming in visual foxpro, i use the data environment and add the two tables, then i relate the two tables by dragging the ITEM_CATEGORY.item_cat_code to ITEM.item_cat_code.
how do i do this in visual basic?
i know how to use hierarchical recordsets (data shaping), but the problem is that i can't edit/addnew/update the records.
am i missing something on hierarchical recordsets? or is there any other way to do this?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement