FIX: COPY TO ... TYPE SDF Incorrectly Copies Null Fields

Last reviewed: October 29, 1997
Article ID: Q161054
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0

SYMPTOMS

The COPY TO <filename> TYPE SDF does not properly copy null type fields. The null fields do not appear in the output text file. The null fields in the SDF file have a zero width.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0a.

MORE INFORMATION

The following program illustrates this behavior.

Steps to Reproduce Behavior

  1. Create a program containing the following code and execute it:

    CREATE CURSOR test (C1 C(5) NULL, C2 C(5) NULL, C3 C(5) NULL, C4 C(5); NULL) FOR i=1 TO 10

          IF MOD(i,2)=0
    
             INSERT INTO test (C1,C2,C3,C4) VALUES ('AAAAA',NULL,'CCCCC',NULL)
          ELSE
             INSERT INTO test (C1,C2,C3,C4) VALUES (NULL,'BBBBB',NULL,'DDDDD')
          ENDIF
       ENDFOR
       BROWSE
    
    

  2. Close the Browse window and type the following commands in the Command window:

    COPY TO Test.txt TYPE SDF MODI COMM Test.txt

  3. Notice the null fields from the cursor are not present in the SDF text file.
Keywords          : buglist3.00 buglist3.00b buglist5.00 FxprgGeneral vfoxwin vfpfix5.0a kbprg kbbuglist kbfixlist
Version           : 3.0 3.0b 5.0
Platform          : WINDOWS
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.

Last reviewed: October 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.