Recent

Author Topic: [SOLVED]Foreign key in DBgrid shows as (MEMO)  (Read 4003 times)

Ianspeed

  • Newbie
  • Posts: 2
[SOLVED]Foreign key in DBgrid shows as (MEMO)
« on: September 16, 2016, 10:34:03 am »
Hi All, sorry if I posted this in the wrong section or something else, my first post! Coming back  in to programming from a long break from Delphi! Really impressed with Lazarus! Here's my problem. Have a table with an associated table connected with a foreign key. This just holds the card type (PG5x7, LG5x7, DL and PDL) this associated file is for a lookup on the card type. This works in SQLite Studio but doesn't work in my test project or the Lazarus desktop database, my thoughts are I have set something up wrong in the database, as surely the DBGrid should just see the associated link to card type and create a lookup field? Or maybe I'm wrong and have to code for it? I have scoured the web of all knowledge(think it ran dry with this one!), but there doesn't seem to be a direct answer or problem like this, so I guess it's something simple I'm missing!  :-[
« Last Edit: September 21, 2016, 01:32:06 pm by Ianspeed »

vdubeau

  • New Member
  • *
  • Posts: 27
Re: Foreign key in DBgrid shows as (MEMO)
« Reply #1 on: September 17, 2016, 10:18:53 pm »
I'm pretty new to Lazarus myself but I have run across this. You probably have the field defined as TEXT. DBGrid seems to interpret this as a memo field and can't display it. Change the field type to VARCHAR (I know they are really the same to SQLIte) and DBGrid should display it correctly.

Ianspeed

  • Newbie
  • Posts: 2
Re: Foreign key in DBgrid shows as (MEMO)
« Reply #2 on: September 19, 2016, 10:46:06 am »
Thanks vdubeau,
This now shows the data in the DBGrid, but unfortunately still won't give me a drop down selection, does this have to be coded manually? Thanks

 

TinyPortal © 2005-2018