Recent

Author Topic: [SOLVED] TDBMemo but with Lookup? -> Went different route  (Read 940 times)

LeadGuit

  • New Member
  • *
  • Posts: 24
[SOLVED] TDBMemo but with Lookup? -> Went different route
« on: March 27, 2021, 09:19:08 pm »
Hi there,

I'm trying to take advantage of the components as much as I can (fun way to work coming from command line ;-))
Now I'm somewhat stuck and am unsure how to continue:

Ich have a DB with multiple tables, with FKs. I am using SELECT * statements to grab the main data (to take advantage of the DBNavigator component to update and insert) and am Using LookupComboBoxes to normalize the FKs. That works nice so far - the stone I encounter though is one specific field that contains a TEXT - an address (so multi-line text).

The LookupComboBox doesn't seem to render newlines, and the memobox can't perform a lookup - is there a way around this which I haven't seen, a component that I can drop in to do this, or do I have to create a seperate logic for this one field?

For more context - I have a DB grid with the main data, on selection of a row all the details are fileld into DBEdits and LookupComboBoxes (those on the resolved FK fields). I hope this make sense.

Best,
Mat
« Last Edit: March 30, 2021, 09:25:55 pm by LeadGuit »
Lazarus 2.0.12, FPC 3.2.0. Win 10

Computational Linguist by day, Film/TV Composer by night.

egsuh

  • Hero Member
  • *****
  • Posts: 1273
Re: TDBMemo but with Lookup?
« Reply #1 on: March 29, 2021, 01:51:10 pm »
AFAIK, some? many? databases do not allow search on blob or memo type fields.

Try to add a calculated field, which transforms TMemoField (i.e. Blob field) into string type field, and do search on that calculated field. --- not sure as I haven't done this myself. But this may be a way-around.   

LeadGuit

  • New Member
  • *
  • Posts: 24
Re: TDBMemo but with Lookup?
« Reply #2 on: March 30, 2021, 09:25:18 pm »
Thank you,

I don't know of any (the documentations and way to see what packages/modules are available is really opaque). In the end, I switched the whole thing from a convenient "low code" approach to program the SQL statements by hand (and on the way replaced that lookup field with three comboboxes to play it safe). With that approach I could've also used a standard Memo, but I think the "drag and drop database application" way doesn't go really far.

I mark this as "Solved" - just so it's clear that I'm not directly searching for answers anymore as I've taken another road. But please, if you, reader, knows what package provides something useful, I'm happy to hear it :-)
Lazarus 2.0.12, FPC 3.2.0. Win 10

Computational Linguist by day, Film/TV Composer by night.

 

TinyPortal © 2005-2018