Solved

Delphi database relationships

Posted on 1998-04-13
2
223 Views
Last Modified: 2013-11-23
Hello all,

      I'd like to knom how to built 1 to 1, 1 to n, m to n relationships in delphi databases using paradox tables? Paradox allows duplicated keys? How?

                  Tanks in advance
0
Comment
Question by:oberdan
2 Comments
 
LVL 5

Expert Comment

by:julio011597
ID: 1361483
Yes, Paradox tables allow duplicate keys as long as they belong to secondary indexes.

Is this what you were looking for?
0
 
LVL 4

Accepted Solution

by:
itamar earned 100 total points
ID: 1361484
Hi oberdan,

To implement relations:

1 to 1 - ORDERS.CustNo -> CUSTOMERS.CustNo
             In CUSTOMERS, CustNo must be the primary key or a unique index, so the relation will be from 1 record to 1 record;

1 to n - ORDERS.OderNo -> ITEMS.OrderNo
            In ITEMS, OrderNo must be a SECONDARY index AND with the Unique check box             unchecked. (This answer your second question). It's a typical master/detail model.

m to n - Not only in Paradox, but in any relational model, you must convert this relation in a               separated table with 2 fields, one for each foreign key of the tables related.

I sugest you to take a look at the ORDERS and ITEMS tables of DBDEMOS alias of Delphi.
There are typical cases in it.

IHTH,
Itamar


0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question