Page 1 of 1

Memo as string?

Posted: Wed 18 Nov 2009 11:55
by upscene
Hi,

Is it possible to display a (wide)memo as a (wide)string?

I do not like (MEMO) or (WIDEMEMO) as the text, is it an option somewhere, I cannot find it?

Most other componentsets display the blob string as normal data.


Thanks.

Posted: Thu 19 Nov 2009 08:44
by Plash
There is no such option.

Posted: Thu 19 Nov 2009 21:13
by tobias_cd
@upscene: depending on your RDBMS, you could do an explicit type conversion within your SELECT with the CAST function.
Example for MS SQL Server to add a new column ("mymemo" being the original "TEXT" column):

SELECT mymemo, CAST(mymemo AS VARCHAR(200)) AS MemoString
FROM mytable

Then just use the new column "MemoString" in your grid (read-only), which should be detected as regular TStringField.

Posted: Wed 25 Nov 2009 08:48
by upscene
Hello Tobias,

Thank you for the suggestion, but I'm unable to modify SQL statements like that ;)

However, what I can do, is using the TField event to display the string, that could help as well.