VFP 9 SP2 on a Win7 platform
When two tables are combined into one using a SQL SELECT UNION command the memo field becomes corrupted (FPT missing or invalid message when accessing the table) if more than 16 records with data in one of the memo fields when one the the tables is empty. Has anyone seen anything like this?
I suspect it has something to do with how the SQL-SELECT UNION operates to combine the tables.
Here is some code to reproduce:
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 ;
)
FOR x = 1 TO 20
APPEND BLANK
ENDFOR
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
* Aborts here with the FPT is missing or invalid message
ALTER TABLE test3 ;
ADD COLUMN cStatus C(10)
Repeat the process but load M1 in first 16 records of test1 and all works.
Any ideas are appreciated...thanks
When two tables are combined into one using a SQL SELECT UNION command the memo field becomes corrupted (FPT missing or invalid message when accessing the table) if more than 16 records with data in one of the memo fields when one the the tables is empty. Has anyone seen anything like this?
I suspect it has something to do with how the SQL-SELECT UNION operates to combine the tables.
Here is some code to reproduce:
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 ;
)
FOR x = 1 TO 20
APPEND BLANK
ENDFOR
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
* Aborts here with the FPT is missing or invalid message
ALTER TABLE test3 ;
ADD COLUMN cStatus C(10)
Repeat the process but load M1 in first 16 records of test1 and all works.
Any ideas are appreciated...thanks