访问 2003 父/子递归搜索
我如何创建父/子关系,VB6.5 将使用递归搜索将其放入树状视图中。
在开始使用主数据库之前,我正在试验一个简单的表结构。
ID | Part | ParentId
-----+-----------+---------
1 | Tire | 0
2 | Door | 0
3 | Break | 1
4 | Line | 3
5 | Handle | 2
6 | Fluid | 4
and so on
然后我想以以下格式在列表框中显示结果
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
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 | 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个不错的(但格式不正确:)解决方案: Recursive Joins to在 Microsoft Access 中查询数据层次结构
作者还指出了如何在其他 DBMS(如 Oracle)中完成此操作。
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).