General information
Category:
Database DAO/RDO/ODBC/ADO
Title:
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?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only