locked
memo file ... missing or is invalid after Select UNION RRS feed

  • Question

  • VFP 9 SP2 Win 7

    A SELECT UNION ALL command creates a table with 11 memo fields.  Of those eleven fields one (1) has data. If there are 17 or more records with data in the field get a missing or invalid FPT message when the table is accessed.  I checked the data -- no corruption in the source field. As a test I just put in the A, B, C, etc or 1,2,3 etc in the each record and get the same result.  I then added some data to the other memo fields with same result. Anyone have any ideas on why 17 records is an issue but 16 is not? 

    Thanks.

            

    Monday, March 14, 2011 3:11 PM

Answers

  • Hmm... Negative surprise...

    This is a bug in VFP. And I would say serious bug which is not related to operating system. The memo file is corrupted after UNION ALL but I cannot say why. This behavior is incorrect even in VFP 8  (VFP 5 is OK).

    Your options are:

    1) Ask Microsoft for paid hotfix (and please let us know how much it costs)

    2) Don't use UNION ALL but APPEND FROM:

    SELECT * FROM test1 WHERE 1=0 INTO TABLE test2
    SELECT * FROM test1 INTO TABLE test3

    SELECT test3
    APPEND FROM test2

    3) Change memo block size, e.g.

    SET BLOCKSIZE TO 0

    and it will work but I cannot say if the bad behavior is fixed or just hidden and waiting for another conditions to appear again...

    When you

    SET BLOCKSIZE TO 2

    then the error appears much earlier...

     

    • Marked as answer by VBVa Tuesday, March 15, 2011 3:37 PM
    Monday, March 14, 2011 9:59 PM

All replies

  • Hope you are creating the table in a folder where you have full access rights.

    Post a short code which will allow to reproduce this behavior. Something like:

    CREATE TABLE SomeTable (aa memo, bb memo, ...)
    INSERT INTO  SomeTable VALUES ("Some text", "", ...)
    etc.

    SELECT * FROM SomeTable
    UNION
    SELECT * FROM SomeOtherTable

     

    Monday, March 14, 2011 3:25 PM
  • Do have acccess rights.

    Additinal information:  One the tables has no records the other does

    CREATE TABLE

     

     

    test1 FREE ;

    ( nPk I, ;

    M1 M, ;

    M2 M, ;

    M3 M, ;

    M4 M, ;

    M5 M, ;

    M6 M, :

    M7 M, ;

    M8 M, ;

    M9 M, ;

    M10 M, ;

    M11 M ;

    )

    REPLACE ALL

     

     

    nPK WITH RECNO(), M1 WITH ALLTRIM(STR(RECNO())

    * Create an empty table

    SELECT

     

     

    * FROM test1 WHERE nPk = -8765 INTO TABLE test2

    SELECT

     

     

    test1.*;

     

     

    FROM test1;

     

     

    UNION ALL SELECT test2.*;

     

     

    FROM test2;

    INTO TABLE

     

     

    test3.DBF

     

    * Browse table and abort when curor in first memo column

    * Or attempt an ALTER TABLE command to add a column

     

     

     

     

     

    Monday, March 14, 2011 6:06 PM
  • Hmm... Negative surprise...

    This is a bug in VFP. And I would say serious bug which is not related to operating system. The memo file is corrupted after UNION ALL but I cannot say why. This behavior is incorrect even in VFP 8  (VFP 5 is OK).

    Your options are:

    1) Ask Microsoft for paid hotfix (and please let us know how much it costs)

    2) Don't use UNION ALL but APPEND FROM:

    SELECT * FROM test1 WHERE 1=0 INTO TABLE test2
    SELECT * FROM test1 INTO TABLE test3

    SELECT test3
    APPEND FROM test2

    3) Change memo block size, e.g.

    SET BLOCKSIZE TO 0

    and it will work but I cannot say if the bad behavior is fixed or just hidden and waiting for another conditions to appear again...

    When you

    SET BLOCKSIZE TO 2

    then the error appears much earlier...

     

    • Marked as answer by VBVa Tuesday, March 15, 2011 3:37 PM
    Monday, March 14, 2011 9:59 PM