Recent

Author Topic: problem with dbgrid. the (MEMO) attacks again  (Read 3720 times)

fabiopesaju

  • Jr. Member
  • **
  • Posts: 93
problem with dbgrid. the (MEMO) attacks again
« on: May 22, 2015, 02:25:46 pm »
I know there are several threads talking about the same subject, but I did not find any compatible my need.

the problem is with the (MEMO) that appears in dbgrid column.

I am using mysql with zeosdb, and using the native dbgrid.

when you run the command:
show full columns from table_name

It is returned many fields, but the fields 'type' and 'default' appears written "(MEMO)"

how to change it to bring up the correct contents of the field? I would like to do this without having to add the fields in zquery or dbgrid. it's possible?

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: problem with dbgrid. the (MEMO) attacks again
« Reply #1 on: May 22, 2015, 02:50:54 pm »
How to change it to bring up the correct contents of the field? I would like to do this without having to add the fields in zquery or dbgrid. it's possible?

The fact that you do not add them means only that they are auto created at runtime when the dataset is opened. So locate your favorite solution and run through the fields on an after open event and manually attach the gettext/settext events to the tmemo fields.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: problem with dbgrid. the (MEMO) attacks again
« Reply #2 on: May 22, 2015, 03:29:40 pm »
Zeos returned blob as field type instead string or whatever. That's why you see (MEMO).
EDIT: I can see that with Zeos 6.XX something, when field of type text is returned from postgresql database. Cast to varchar helps.

fabiopesaju

  • Jr. Member
  • **
  • Posts: 93
Re: problem with dbgrid. the (MEMO) attacks again
« Reply #3 on: May 26, 2015, 01:07:22 am »
thank you taazz and zeljko...

taazz, i did that... i wanted another solution but this works perfectly...

zeljko, i can't use cast because is a ddl command (show full columns from xx)...

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: problem with dbgrid. the (MEMO) attacks again
« Reply #4 on: May 26, 2015, 10:02:41 pm »
Try this and check the threads on the zeoslib support forum.

TZConnection.Properties.Add('Undefined_Varchar_AsString_Length= 255');

http://zeoslib.sourceforge.net/viewtopic.php?t=10728

http://zeoslib.sourceforge.net/viewtopic.php?t=15798
Lazarus 3.0/FPC 3.2.2

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
Re: problem with dbgrid. the (MEMO) attacks again
« Reply #5 on: April 21, 2018, 07:56:19 am »
Hi

sorry for i run this topic again

i use zeos7.1.4 and evrey thing was OK.

i can read/Write to DB of SQLite.(windows XP - Lazarus1.8 )

i added "Properties.Add('Undefined_Varchar_AsString_Length = 255');"  , but when i update Zeos7.2 , i can't read from DB?!?!?

what is my wrong??

help me please
« Last Edit: April 21, 2018, 07:59:40 am by majid.ebru »

 

TinyPortal © 2005-2018