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

More Question More Delphi with Access

答題得分者是:timhuang
Vashee
初階會員


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

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-06 01:02:25 IP:217.36.xxx.xxx 未訂閱
This is regarding the last post 'The use of Delphi with Access' To Justmade: I have a question regarding your table layout suggestion. If (History Table) Order Number (Primary Key) Order Time (Detail Table) Order Number (Primary Key) Dish ID (Primary Key) Quantity If both Order Number is set to Primary Key, It will be a One to One basic, however, it will be many items under the same OrderNumber in the Detail Table. Also, I cannot set two primary keys in the same table
timhuang
尊榮會員


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-06 10:41:55 IP:61.221.xxx.xxx 未訂閱
引言: If both Order Number is set to Primary Key, It will be a One to One basic, however, it will be many items under the same OrderNumber in the Detail Table. Also, I cannot set two primary keys in the same table
Hi, you can select both Order Number and Dish ID from Detail Table and set a compound primary key which combined with more than one column. It's not to set two independent primary keys in one table. Each table only has one primary key.
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-04-06 12:20:31 IP:218.16.xxx.xxx 未訂閱
引言: it will be many items under the same OrderNumber in the Detail Table
It is exactly why you need to use both the Order Number and Dish ID to be the primary key. A primary key cannot have repeated value. So, if you set OrderNumber as primary key, you can only have 1 record per Order Number. However, if you use both, you can have many records with same Order Number provided that the Dish ID is different.
Vashee
初階會員


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

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-04-06 15:21:06 IP:217.36.xxx.xxx 未訂閱
Cool Cool.Thanx Tim    Justmade, can u plz help me further on my project? u helped me along the whole way, might as well bring me to the end. plz plz.. I just can't figure things out by my own
系統時間:2024-05-19 0:55:46
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!