Memo as string?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Memo as string?

Post by upscene » Wed 18 Nov 2009 11:55

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 19 Nov 2009 08:44

There is no such option.

tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

Post by tobias_cd » Thu 19 Nov 2009 21:13

@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.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Wed 25 Nov 2009 08:48

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.

Post Reply