设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

12下一页
返回列表 发新帖
查看: 3306|回复: 13
打印 上一主题 下一主题

[求助]怎樣實現參數的級連轉遞?

[复制链接]
跳转到指定楼层
1#
发表于 2002-9-12 22:27:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
級連的定義,就要表參照一樣,父表的變更,直接影影響著子表也隨著變更。
現在實發奇想,有一個數據庫,很多表都是一對多的關係。
如定單->定單項->定品->部分加工(在這個例字中都是一對多的關係)
哪麼現在想給存儲過程定單傳遞一個參數,而此參數可以找出與此有關的定單項,與此有關的定單項又可找出與此有關定單項的產品等等,以此類推。
哪麼存儲過程我譔怎樣作,最終顯示報表又該怎麼作?
請有經以的高手,指點給點?
多謝!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2002-9-13 10:21:00 | 只看该作者
TRY DOCOMD.RUNSQL
3#
 楼主| 发表于 2002-9-13 16:54:00 | 只看该作者
老大,這個不想想像中的哪麼好搞定呀,這是一個創新的作法。

点击这里给我发消息

4#
发表于 2002-9-13 17:15:00 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
5#
 楼主| 发表于 2002-9-13 19:38:00 | 只看该作者
呵呵,如果不編程就行的話,我也不會發問了,現在就是不想搞的很復雜,所以來請教各位了。
6#
发表于 2002-9-13 20:52:00 | 只看该作者
好像pb的数据管道就这样了
7#
 楼主| 发表于 2002-9-13 21:47:00 | 只看该作者
herdsboy:講一下,什麼數據管道,怎麼實現?多謝!
8#
发表于 2002-9-13 21:55:00 | 只看该作者
我也不懂,但好像翻书的时候随便看过有这么个东西
好像就是类似功能的
你找个pb高手问问吧
9#
 楼主| 发表于 2002-9-13 22:03:00 | 只看该作者
我現在有笨方法,可以寮現,但總覺得不理想,所以請大家來參於。
10#
 楼主| 发表于 2002-9-13 23:03:00 | 只看该作者
現在的笨方法就是不斷的用SELECT 子句:如下
select * from order_item
select * from order_item where order_no in (select order_no from [order] where order_no = 'dr9999')
select * from ko where order_no in (select order_no from [order] where order_no = 'dr9999')
select * from dye where ko_no in (select ko_no from ko where order_no in (select order_no from [order] where order_no = 'dr9999'))
select * from templet where dye_no in (select dye_no from dye where ko_no in(select ko_no from ko where order_no in (select order_no from [order] where order_no = 'dr9999')))
select * from tub where tmp_no  in (select tmp_no from templet where dye_no in (select dye_no from dye where ko_no in (select ko_no from ko where order_no in (select order_no from [order] where order_no = 'dr9999'))))
這樣不盡我覺得效率很低,且代碼多,維護起來很難。
不過,沒有用過select子句的朋友,看了這個有什麼感受哪?好玩吧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-6-5 07:03 , Processed in 0.149685 second(s), 33 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表