PRB: Cannot Set a One-to-Many Relationship in Data Designer

Last reviewed: April 30, 1996
Article ID: Q127847
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SYMPTOMS

In the Data Designer, when you drag the mouse from one table to another to draw a one-to-many relationship:

  • The cursor does not change and no relation is drawn.

    -or-

  • The relationship is one-to-one and cannot be set to one-to-many.

CAUSE

The relationships established in the Database Designer are persistent and are used for data integrity. A persistent relation is established from tag to tag, and the nature of the tag determines the type of relationship created.

WORKAROUND

You must have an index created in both the source and target tables before a relationship may be established. The type of relationship that is created is determined by the type of index in the target (child) table. To create a one-to-many relationship, the key index type in the target table must be set to 'regular'. The following pointers may be helpful when creating relationships between tables.

Ensure that you are dragging the mouse from an index tag to an index tag, and verify that the key you are using in the source (parent) table is not a regular key.

If you want to create a one-to-many relationship, verify that the key in the target table is not a candidate or primary key. These types of indexes require that no two records have the same value. It is therefore impossible to have a candidate or a primary key as the target for a one-to-many relationship.

Once you set the relationship, it is shown in the Database Designer as a line connecting the two tables.

STATUS

This behavior by design.

REFERENCES

Visual FoxPro for Windows "User's Guide", version 3.0, Chapter 5, "Collecting Tables into a Database."

Visual FoxPro for Windows "Developer's Guide", version 3.0, Chapter 6, "Using Databases."


Additional reference words: 3.00 VFoxWin modify structure
KBCategory: kbtool kbprb
KBSubcategory: FxtoolDbtabledes


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.