Microsoft KB Archive/158240

= BUG: Inconsistant Results with SET RELATION TO Command =

Article ID: 158240

Article Last Modified on 12/1/2003

-

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 6.0 Professional Edition

-



This article was previously published under Q158240



SYMPTOMS
Issuing the SET RELATION TO command repeated times within a program causes inconsistent results to appear in Browse windows and in Grids. While cycling through the program, some iterations do not show the proper one-to- many relationships between records in the Browse window or Grid object. The placeholder characters (asterisks) in the child record appear in different columns when you repeatedly executes the program.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.



MORE INFORMATION
The code example below illustrates this behavior.

Steps to Reproduce Behavior
  Create a program called Test that contains the following code: IF !(FILE('custfree.dbf') AND FILE('ordfree.dbf');        AND FILE('ordifree.dbf')) CLOSE ALL SET DEFAULT TO c:\vfp5\samples\DATA USE customer COPY TO custfree USE orders COPY TO ordfree USE orditems COPY TO ordifree USE ordifree INDEX ON order_id TAG order_id USE ordfree INDEX ON cust_id TAG cust_id USE custfree INDEX ON cust_id TAG cust_id ENDIF

CLOSE ALL

ON KEY LABEL f2 CLEAR EVENTS FOR i=1 TO 10

CLOSE ALL

OPEN DATABASE testdata

USE customer

SELECT 0 USE ordifree SET ORDER TO TAG order_id

SELECT 0 USE ordfree SET ORDER TO TAG cust_id SET RELATION TO order_id INTO ordifree

SET SKIP TO ordifree

SELECT 0 USE custfree SET RELATION TO cust_id INTO ordfree

SET SKIP TO ordfree,ordifree BROW LAST FIELDS custfree.cust_id,ordfree.order_id, ; ordifree.line_no NOWAIT TITLE 'two' READ EVENTS

NEXT ON KEY LABEL f2     CLOSE ALL CLEAR ALL  Execute the program and note that asterisk characters appear in the Order_id field and data appears in the Line_no field. Press F2 and note that the display reverses. The Line_no field now contains asterisk characters and the Order_id field contains data. As you continue to press F2 to reissue the SET RELATION TO command, these fields continue to alternate their contents.

Additional query words: kbdse VFoxWin

Keywords: KB158240

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.