KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q168043: FIX: Grid is Empty with Incorrect Column ControlSource

Article: Q168043
Product(s): Microsoft FoxPro
Version(s): 5.0 5.0a
Operating System(s): 
Keyword(s): kbvfp kbvfp500bugkbbuglist
Last Modified: 23-MAR-2000

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a 
-------------------------------------------------------------------------------

SYMPTOMS
========

Specifying an invalid column ControlSource name in a Grid results in an empty
grid in Visual FoxPro 5.x. However, in Visual FoxPro 3.x, this results in the
following error, which is expected:

  "Error loading File - ControlSource..., Variable "column name" is not found"

RESOLUTION
==========

Check the ControlSource names in each column and make sure they are valid names.

STATUS
======

Microsoft has confirmed this to be a bug in the Microsoft products listed at the
beginning of this article. This has been corrected in Visual FoxPro 6.0.

MORE INFORMATION
================

Steps to Reproduce Behavior
---------------------------

1. Run the following code from a program (.PRG) file:

        SET SAFETY ON
        USE HOME()+'samples\data\customer'
        LOCAL aobj[1], ox
        CREATE FORM TEMP NOWAIT
        =ASELOBJ(aobj,1)
        ox = aobj[1]
        ox.AddObject('grid1','Grid')
        WITH ox.grid1
           .Recordsource = 'customer'
           .Visible = .T.
           .ColumnCount = 2
           .Column1.ControlSource = 'customer.cust_id'

           * Purposely put an invalid column controlsource name
                .Column2.ControlSource = 'customer.Xcontact'

           * To display the Grid correctly set:
           *   .Column2.ControlSource = 'customer.contact'

        ENDWITH
        KEYBOARD 'Y' CLEAR
        RELEASE WINDOW 'Form Designer'
        DO FORM temp

2. Form shows up with an empty grid.

Additional query words: kbvfp600fix

======================================================================
Keywords          : kbvfp kbvfp500bug kbbuglist
Technology        : kbVFPsearch kbAudDeveloper kbVFP500 kbVFP500a
Version           : 5.0 5.0a
Issue type        : kbbug
Solution Type     : kbfix

=============================================================================

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.

Copyright Microsoft Corporation 1986-2002.