DBGrid now has an option to display memo as text. DisplayMemoText
It uses this code:
if CheckDisplayMemo(aField) then
Result := aField.AsString
Btw, the CAST(field as varchar) in your query no longer works. Nor changing the field type in the DB. SQLite is happy to put pretty much any field type in its SQL statements. But it treats them all like memo fields.