Microsoft Knowledge Base Email Alertz

When you use the SET RELATION TO and SET SKIP TO commands to relate a parent table into many records in a child table that relates to many records in a grandchild table, the view window may actually indicate that a one-to-one relationship exists from...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 139183 - Last Review: May 7, 2003 - Revision: 2.1

BUG: View Not Accurate with One-to-Many Grandchild Relation

This article was previously published under Q139183

SYMPTOMS

When you use the SET RELATION TO and SET SKIP TO commands to relate a parent table into many records in a child table that relates to many records in a grandchild table, the view window may actually indicate that a one-to-one relationship exists from the child table into the grandchild table.

CAUSE

The display of the relation between the child and grandchild table in the view window is incorrect.

WORKAROUND

To determine if the relation is constructed properly, use the BROWSE FIELDS or LIST FIELDS command with fields from the parent, child, and grandchild tables to verify that the relation is correct.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Sample Code to Demonstrate Problem
   *beginning of code
   WAIT WINDOW "For the following to work," + ;
       CHR(13) + "Please take your hand off the mouse" ;
      TIMEOUT 2

   CLOSE DATA

   * create the testing tables
   SET SAFETY OFF
   CREATE TABLE customer (cno c(5), company c(20))
   INSERT INTO customer (cno, company) VALUES ("B9278","1st record")
   CREATE TABLE invoices (cno c(5), ino N(4,0))
   INSERT INTO invoices (cno, ino) VALUES ("B9278",1106)
   INSERT INTO invoices (cno, ino) VALUES ("B9278",1107)
   CREATE TABLE detail (ino N(4,0), pno c(5))
   INSERT INTO detail (ino, pno) VALUES (1107,"AAAAA")
   INSERT INTO detail (ino, pno) VALUES (1107,"BBBBB")
   INSERT INTO detail (ino, pno) VALUES (1107,"CCCCC")
   INSERT INTO detail (ino, pno) VALUES (1106,"AAAAA")
   INSERT INTO detail (ino, pno) VALUES (1106,"BBBBB")
   SET SAFETY ON
   CLOSE ALL

   USE detail.DBF EXCLUSIVE IN 0
   SELECT detail
   DELETE TAG ALL
   INDEX ON ino TAG ino
   SET ORDER TO ino

   USE invoices.DBF EXCLUSIVE IN 0
   SELECT invoices
   DELETE TAG ALL
   INDEX ON cno TAG cno
   SET ORDER TO cno
   SET RELATION TO ino INTO detail
   SET SKIP TO detail
   USE customer.DBF IN 0
   SELECT customer
   SET RELATION TO cno INTO invoices
   SET SKIP TO invoices
   WAIT WINDOW "Notice how the relation looks in the view"+ ;
    CHR(13)+"Press ESC to continue" NOWAIT
   SET VIEW ON
   BROWSE FIELDS customer.cno, invoices.ino, detail.pno
   CLOSE ALL

   CLOSE DATA
   USE detail.DBF EXCLUSIVE IN 0
   SELECT detail
   DELETE TAG ALL
   INDEX ON ino TAG ino
   SET ORDER TO ino
   USE invoices.DBF EXCLUSIVE IN 0
   SELECT invoices
   DELETE TAG ALL
   INDEX ON cno TAG cno
   SET ORDER TO cno
   SET RELATION TO ino INTO detail

   *set skip to detail
   USE customer.DBF IN 0
   SELECT customer
   SET RELATION TO cno INTO invoices
   SET SKIP TO invoices, detail
   WAIT WINDOW "NOW notice how the relation looks in the view"+ ;
    CHR(13)+"Press ESC to continue" NOWAIT
   ACTIVATE WINDOW VIEW
   BROWSE FIELDS customer.cno, invoices.ino, detail.pno
   CLOSE ALL

   KEYBOARD("{ESC}")     && to remove view window

   *end of code
				

APPLIES TO
  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft Visual FoxPro 3.0b Standard Edition
  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 5.0a
  • Microsoft Visual FoxPro 6.0 Professional Edition
Keywords: 
kbbug kbprogramming KB139183
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate