Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/172923

From BetaArchive Wiki

Article ID: 172923

Article Last Modified on 3/24/2000


  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 5.0a

This article was previously published under Q172923


Issuing two consecutive COPY TO <filename> TYPE SDF commands causes Visual FoxPro 5.0x to return the following error message on the second command:

File <filename>.txt already exist as part of a database.

This error does not occur in Visual FoxPro 3.0b.


Check for the existence of the first SDF file and if it exists delete it. In the code example in the MORE INFORMATION section below, the following code accomplishes this task. Place the code between the two COPY TO commands:

   IF FILE("test1.txt")=.t.
      DELETE FILE test1.txt


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.


The error message occurs only when zero (0) is the first character in the SDF file. However, if the resulting SDF file is smaller than 8000 bytes, the error does not occur even if the zero character is in the SDF file. Finally, choosing any other file format or placing any other character in the SDF file prevents the error.

Steps to Reproduce Behavior

Create a program that contains the following code and execute it:

   CREATE TABLE test1.dbf FREE (f C(100))
   FOR i = 1 TO 80
      INSERT INTO test1 VALUES ("0")
   COPY TO test1.txt TYPE SDF
   COPY TO test1.txt TYPE SDFF

The error appears on the second COPY TO command.

Additional query words: sdf

Keywords: kbbug kbfix kbvfp600fix kbprb KB172923