Problem : Operation is invalid for a Memo, Blob, General or Picture field
Of our programs was recently upgraded from Foxpro 7.0 sp2 to Foxpro 9.0 sp2, and one code line that states:
SELECT * DISTINCT FROM oldcompany INTO CURSOR temp ORDER BY co_code
is now giving an error #34
“Operation is invalid for a Memo, Blob, General or Picture field”
whenever it is run. If works fine under Foxpro 7.0.
The error message in Foxpro Help states:
* An INDEX command cannot specify a Memo or Blob field as its key expression.
* There was not enough memory for Visual FoxPro to complete an operation.
* Unions between differing column types are not allowed when one of the columns is of Memo or General type unless UNION ALL is used.
But I do not have INDEX for the cursor, plenty of machine memory, and a UNION of SELECTs is not involved, so I cannot figure how the error applies. Any ideas?
Solution: Operation is invalid for a Memo, Blob, General or Picture field
In fact, since the documented syntax has the DISTINCT clause first, try the original command with the cursor but changing only the placement of the DISTINCT word. Sometimes, MS tightens up the parsing rules in VFP and I know that VFP9’s SQL enhancements were worked on by a different MS Fox developer than the VFP7 version. Maybe he made the rules stricter for adhering to the documentation’s syntax, which more than likely more closely as a whole matches ANSI standards anyway.
SELECT DISTINCT * FROM oldcompany INTO Cursor temp ORDER BY co_code