>> Then I tried to get the data from the column of type Varchar(MAX) without CursorAdapter. I do SQL Select and then assign the value of the column to a variable. The variable is EMPTY.
If interested, check out my Foxfest VFPA white paper that covers this exact bug returning an impossible C(0) field type from SPT. VFPA definitely fixes the bug, for XML and VarBinary(MAX) too.
The issue with CAST is that when MS deprecates TEXT as it has signaled for well over a decade now, there's no guarantee that casting as text will still function.
HTH
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us."
-- Shakespeare: Coriolanus, Act 1, scene 1