Recent

Author Topic: TDBEdit displays (MEMO) instead of original value  (Read 1181 times)

@VladislavL

  • New Member
  • *
  • Posts: 10
TDBEdit displays (MEMO) instead of original value
« on: March 16, 2023, 10:10:26 am »
How to correct this behavior?

dseligo

  • Hero Member
  • *****
  • Posts: 1290
Re: TDBEdit displays (MEMO) instead of original value
« Reply #1 on: March 17, 2023, 12:20:02 pm »
In you select statement do this for column that behaves like this in dbedit:
Code: Pascal  [Select][+][-]
  1. SQL.Text := 'select ..., cast(your_column as varchar(50)) as your_column, ... '

Zvoni

  • Hero Member
  • *****
  • Posts: 2480
Re: TDBEdit displays (MEMO) instead of original value
« Reply #2 on: March 17, 2023, 02:04:52 pm »
How to correct this behavior?
By searching the Forum first....
i think this question has been asked and answered at least 5 times in the last two years
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

JanRoza

  • Hero Member
  • *****
  • Posts: 679
    • http://www.silentwings.nl
Re: TDBEdit displays (MEMO) instead of original value
« Reply #3 on: March 17, 2023, 03:07:28 pm »
Why use tDbEdit on a memo field, use tDbMemo instead.
OS: Windows 11 / Linux Mint 21.3
       Lazarus 3.4 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

@VladislavL

  • New Member
  • *
  • Posts: 10
Re: TDBEdit displays (MEMO) instead of original value
« Reply #4 on: March 17, 2023, 04:01:42 pm »
In you select statement do this for column that behaves like this in dbedit:
Code: Pascal  [Select][+][-]
  1. SQL.Text := 'select ..., cast(your_column as varchar(50)) as your_column, ... '
Thanks, I'll try.

@VladislavL

  • New Member
  • *
  • Posts: 10
Re: TDBEdit displays (MEMO) instead of original value
« Reply #5 on: March 17, 2023, 04:04:35 pm »
Why use tDbEdit on a memo field, use tDbMemo instead.
I have a simple text field, not a memo.

JanRoza

  • Hero Member
  • *****
  • Posts: 679
    • http://www.silentwings.nl
Re: TDBEdit displays (MEMO) instead of original value
« Reply #6 on: March 17, 2023, 05:28:08 pm »
If a tdbedit or tdbgrid shows ‘Memo’ it usually means that the source field in the database is a memo field. Have you tried replacing the tdbedit by a tdbmemo, just as a test?
OS: Windows 11 / Linux Mint 21.3
       Lazarus 3.4 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

Zvoni

  • Hero Member
  • *****
  • Posts: 2480
Re: TDBEdit displays (MEMO) instead of original value
« Reply #7 on: March 17, 2023, 10:08:59 pm »
If a tdbedit or tdbgrid shows ‘Memo’ it usually means that the source field in the database is a memo field. Have you tried replacing the tdbedit by a tdbmemo, just as a test?
He‘s probably using SQLite, and it‘s a known issue with DBGrid for SQLite text columns that the grid thinks it‘s memo instead of plain text
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

JanRoza

  • Hero Member
  • *****
  • Posts: 679
    • http://www.silentwings.nl
Re: TDBEdit displays (MEMO) instead of original value
« Reply #8 on: March 17, 2023, 11:49:30 pm »
But he specifically mentions tdbedit and not tdbgrid, that is why I ask.
OS: Windows 11 / Linux Mint 21.3
       Lazarus 3.4 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

@VladislavL

  • New Member
  • *
  • Posts: 10
Re: TDBEdit displays (MEMO) instead of original value
« Reply #9 on: March 18, 2023, 03:31:48 am »
If a tdbedit or tdbgrid shows ‘Memo’ it usually means that the source field in the database is a memo field. Have you tried replacing the tdbedit by a tdbmemo, just as a test?
He‘s probably using SQLite, and it‘s a known issue with DBGrid for SQLite text columns that the grid thinks it‘s memo instead of plain text
You're right.

@VladislavL

  • New Member
  • *
  • Posts: 10
Re: TDBEdit displays (MEMO) instead of original value
« Reply #10 on: March 18, 2023, 03:34:52 am »
In you select statement do this for column that behaves like this in dbedit:
Code: Pascal  [Select][+][-]
  1. SQL.Text := 'select ..., cast(your_column as varchar(50)) as your_column, ... '
It helped, thanks.

 

TinyPortal © 2005-2018