access 2003 parent/child recursive search
How do i create a parent/child relationship that VB6.5 will put into a tree like view using a recursive search.
I have a simple table structure that I'm experementing with before I begin using the main database.
ID | Part | ParentId
-----+-----------+---------
1 | Tire | 0
2 | Door | 0
3 | Break | 1
4 |开发者_StackOverflow中文版 Line | 3
5 | Handle | 2
6 | Fluid | 4
and so on
Then I want to display the results in a listbox in the format of
ID | Part | Relationship
-----+-----------+---------------------------------------------------
1 | Tire | Tire
3 | Break | Tire | Break
4 | Line | Tire | Break | Line
6 | Fluid | Tire | Break | Line | Fluid
2 | Door | Door
5 | Handle | Door | Handle
A nice (but not well formated :) solution: Recursive Joins to Query Data Hierarchies in Microsoft Access
The author also points out how this can be done in other DBMS (like Oracle).
精彩评论