(MEMO) in the DBGrid cell

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
alperozbek
Posts: 1
Joined: Wed 21 Feb 2007 18:58
Location: TURKEY

(MEMO) in the DBGrid cell

Post by alperozbek » Wed 21 Feb 2007 20:23

I am using a table which has tiny text field. I want to see field values in a CRDBGrid component. But after compiling the program, there are (MEMO) text filled in the cells. I can see the right values after click on them. I added a calculated field that converts memo to string. I can see the right values in the calculated field. But are there any better way to view or edit text fields in a DBGrid? The maximum number of letters is about 20.

Thanks,
Alper ÖZBEK

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 22 Feb 2007 09:36

We can suggest several ways to solve this problem:
  • - convert column type in the table to CHAR or VARCHAR;
    - convert column type to string in your query. This may look like the following:

    Code: Select all

    SELECT uid, ttext + '' as ttext FROM tb_ttext;
    ttext represents the TYNYTEXT field;
    - to view text fields in DBGrid, you should create all the fields of your dataset and add the following handler for the field that represents TYNYTEXT field:

    Code: Select all

    Text := Sender.AsString;
    - use any third party db-aware controls.

Post Reply