全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1127
推到 Plurk!
推到 Facebook!

Access :Entity Relationship problem

尚未結案
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-05-10 19:47:51 IP:217.36.xxx.xxx 未訂閱
First i will show the table i have made: Student Detail: Candidate Number (Primary Key) Center Number Candidate Name Center Name Exam Results Subject Name Subject Reference Code (Primary Key) Candidate Number (Primary Key) Original Mark Remark Mark Grades Script Return I have set up a Master Detail relatetionship between them and it is successful. but link Studen Detail(Candidate No.) to Exam Results(Candidate No.) as a One To Many Relationships. However, as extra constraint is added afterwards: Candidate number will be unique with one centre, but not between centres. That means there could be 2 identifical Candidate number with 2 centres To overcome this problem i did some changes: Student Detail: Candidate Number (Primary Key) Center Number (Primary Key) Candidate Name Center Name This will overcome the problem, by making combination pri. keys but the master detail relationship won't work any more. How can i overcome this problem maintaining the masterdetail relationship?# Thanks
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-05-10 20:08:21 IP:217.36.xxx.xxx 未訂閱
Nevermind lol, I just solved the problem myself by doing this: Student Detail Candidate Number (Primary Key) Center Number (Primary Key) Candidate Name Center Name Exam Results Subject Name Subject Reference Code (Primary Key) Candidate Number (Primary Key) Center Number (Primary Key) Original Mark Remark Mark Grades Script Return I made a triple combination. hehe :)
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-05-10 22:42:05 IP:217.36.xxx.xxx 未訂閱
Oh sorry, the problem still haven't solved. when I try to set up a master-detail relationship in Field Link Designer by adding Candidate Number > Candidate Number Center Number > Center Number it shows up the following message: arguements are of the wrong type, are out of acceptable range or are in conflict with one another. Any idea of the problem?
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-05-11 00:37:25 IP:61.221.xxx.xxx 未訂閱
Hi, maybe the relative columns are not the same datatype. Center Number in master is string, but Center Number is detail is integer.. just guest... 
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-05-11 00:59:32 IP:217.36.xxx.xxx 未訂閱
nope, all the data type is set as 'Text' in access.. this is very weird i have successfully linked up the relationship in access and the table (in access) also can show subsection detail of a record. wonder why it doesn't work in delphi :(
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-05-11 01:19:18 IP:61.221.xxx.xxx 未訂閱
I've tried the same table schema in ACCESS like yours and make a master-detail form with TField Link Designer. It still work well ... .
Vashee
初階會員


發表:38
回覆:87
積分:25
註冊:2003-03-31

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-05-11 02:25:22 IP:217.36.xxx.xxx 未訂閱
what did u do in TLink Designer? just adding: Center Number > Center Number Candidate Number > Candidate Number ? Also, if there is another Master table linking to that detail table, will it cause any probelms? The third table is: Subject Name Subject Reference Code (Primary Key) it is also linked to the Results Table as well
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#8 引用回覆 回覆 發表時間:2003-05-11 22:12:05 IP:61.221.xxx.xxx 未訂閱
Yes, just add 2 relative mapping column pairs.    I don't know what you mean 'there is another Master table linking to that detail table', because the master detail is one-to-one table relation. One-to-two master/detail relation is accept. But two master to one detail relation is not allowed in one form. The detail table 'master field' and 'master datasource' are set to one master table not for two master table. If you want to design one-one-one three cascade master/detail are also can be accept. Just set the second table 'master datasource' to the first table and set the third table 'master datasource' to the second table.    
1. OK one-two master/detail
MASTER - Detail
       \ Detail
...
2. OK one-one-one master/detail
MASTER - Detail(for first) / Master(for third) - Detail
...
3. WRONG two-one master/detail
MASTER - Detail
MASTER /
系統時間:2024-06-29 9:10:36
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!