Recent

Author Topic: Lookup fields do not return data.  (Read 31992 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lookup fields do not return data.
« Reply #30 on: September 15, 2012, 04:55:08 pm »
You perhaps only built a debug ide? The bufdataset unit is fpc so that won't be included in a debug build.
You'll need to run something like make --OPT="-gw -gl" (not sure of exact option name etc)

... or using fpcup to get a debug everything build for Laz SVN, with FPC fixes 2.6.1:
Quote
fpcup --fpcopt="-gw -gl" --lazopt="-gw -gl"
Make sure you have nothing in c:\development and that you have write permissions there. However, it will happily exist side-by-side with existing Lazarus/FPC installs
« Last Edit: September 15, 2012, 04:56:40 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Lookup fields do not return data.
« Reply #31 on: September 15, 2012, 05:05:10 pm »
ok, ok, downloaded fcup created the directory C:\developing I just copy it there and run it?

I already have turtoisesvn installed is there something I should know before sarting the process?

My main idea is use svn version for bugs/enhancements lazarus/fpc specific tasks and keep a clean release installation too for my current projects.
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

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lookup fields do not return data.
« Reply #32 on: September 15, 2012, 05:21:30 pm »
c:\development
unless you want to fiddle around with options (see fpcup --help)
Yes, just put it there.

It's best if tortoisesvn's directory with svn.exe is in your path.
Otherwise no problem, it will download its own svn.exe but you won't get the SVN revision number in your Lazarus/About screen, which can be handy.

Good idea to keep 2 separate installs. That's the way I use it too.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Lookup fields do not return data.
« Reply #33 on: September 15, 2012, 05:26:35 pm »
Had a look at the sample program and the KeyFields and LookupKeyFields are mixed up. Here is the part of the lfm file relative to StringField1 that is changed. Works with laz 1.1 fpc 2.7.1.

Code: [Select]
    object StringField1: TStringField
      DisplayWidth = 45
      FieldKind = fkLookup
      FieldName = 'title'
      Index = 3
      KeyFields = 'fktitleid'
      LookupCache = True
      LookupDataSet = titleQuery
      LookupKeyFields = 'titleid'
      LookupResultField = 'title'
      ProviderFlags = [pfInUpdate, pfInWhere]
      ReadOnly = False
      Required = False
      Size = 45
    end

codifies

  • Jr. Member
  • **
  • Posts: 98
    • bedroomcoders
Re: Lookup fields do not return data.
« Reply #34 on: September 15, 2012, 05:36:15 pm »
I've already tried that way round as mentioned the example posted is the result of trying multiple combinations of possibilities and is in a known to be incorrect state

(notice the screen shot of the dialog I posted shows the same settings you suggest...)

trying your settings when making the query active I see a dialog saying

peopleQuery : Field not found : "titleid"

which is no surprise being as titleid is in the titles table....

If you're saying you have the project working can you do a DIFF against the posted archive and tell us what else you have changed.

Its at least two of us are also seeing serious exceptions and IDE crashes, as well as confusing error messages
« Last Edit: September 15, 2012, 05:40:33 pm by chris_c »
Lazarus 2.3.0 r3945f73 FPC 3.2.0 x86_64-linux-gtk2

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Lookup fields do not return data.
« Reply #35 on: September 15, 2012, 05:49:27 pm »
You perhaps only built a debug ide? The bufdataset unit is fpc so that won't be included in a debug build.
You'll need to run something like make --OPT="-gw -gl" (not sure of exact option name etc)

... or using fpcup to get a debug everything build for Laz SVN, with FPC fixes 2.6.1:
Quote
fpcup --fpcopt="-gw -gl" --lazopt="-gw -gl"
Make sure you have nothing in c:\development and that you have write permissions there. However, it will happily exist side-by-side with existing Lazarus/FPC installs

I S**T i didn't see your reply and started the download with out any options typed in. Should I stop and start over or it will rebuild from local data if I run it again?
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

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Lookup fields do not return data.
« Reply #36 on: September 15, 2012, 05:55:49 pm »
No prob. Wait for it to finish, and run it again with the options. It will still take a while but as you've got the latest svn checkout, at least you won't get any (or many) updated files as it does svn update for both fpc+laz.

OT: I'd suggest laying off the coffee and switching to alcohol in order to increase the relaxation factor ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Lookup fields do not return data.
« Reply #37 on: September 15, 2012, 06:02:00 pm »
Attached the project. I changed to TMysql50Connection since that is the client I'm using. That doesn't impact dblookup. The other thing I added is the FormOnCreate with the following 2 lines:
Code: [Select]
  titleQuery.Open;
  peopleQuery.Open;
The order of opening queries when streaming a form is undetermined (it is the order in the lfm but that can change when modifying a property). Here I force the order. The other way around gives an error message about an inactive dataset. I know, the auto opening of lookupdatasets is a mess. There are several bug reports about that and the maintainer has promised to get rid if that.

codifies

  • Jr. Member
  • **
  • Posts: 98
    • bedroomcoders
Re: Lookup fields do not return data.
« Reply #38 on: September 15, 2012, 06:14:22 pm »
ah right at least there is a known issue with auto opening lookups ! I'm not going insane (it just feels like it!) :D

alas after trying the open commands in form create I'm seeing....

and its not just me is it, that error message *is* confusing!
Lazarus 2.3.0 r3945f73 FPC 3.2.0 x86_64-linux-gtk2

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Lookup fields do not return data.
« Reply #39 on: September 15, 2012, 06:18:38 pm »
Is that using the KeyFields and LookupKeyFields as I use them?

codifies

  • Jr. Member
  • **
  • Posts: 98
    • bedroomcoders
Re: Lookup fields do not return data.
« Reply #40 on: September 15, 2012, 06:37:17 pm »
I think it is the connector I couldn't get the 5.0 connector to work ( ubuntu's libmysqlclient15off_5.0.96-0ubuntu3_amd64.deb package is from a distribution about a year and a half ago )

It only seemed to hang the compiled app when trying to use it

I changed to a 5.1 connector and changed the record names to lower case (are they really case sensitive now a days ! eek! )

and guess what I get exactly the *same* exception

I can only conclude that the issue is either with the 5.1 connector or the mysql driver itself

I'm going to try with postgress and see if I see the same issues....
Lazarus 2.3.0 r3945f73 FPC 3.2.0 x86_64-linux-gtk2

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Lookup fields do not return data.
« Reply #41 on: September 15, 2012, 06:40:16 pm »
No prob. Wait for it to finish, and run it again with the options. It will still take a while but as you've got the latest svn checkout, at least you won't get any (or many) updated files as it does svn update for both fpc+laz.

OT: I'd suggest laying off the coffee and switching to alcohol in order to increase the relaxation factor ;)

Well I didn't got a chance to react after I posted that message laptop shutdown from heat.I just started over again its nice to know that it will continue and not do everything again.

Coffee?? I don't drink coffee I have it pluged as an IV, leaves my hands free for hair pooling.
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

codifies

  • Jr. Member
  • **
  • Posts: 98
    • bedroomcoders
Re: Lookup fields do not return data.
« Reply #42 on: September 15, 2012, 07:53:07 pm »
damn - same error message with postgres too..... :(
Lazarus 2.3.0 r3945f73 FPC 3.2.0 x86_64-linux-gtk2

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Lookup fields do not return data.
« Reply #43 on: September 16, 2012, 01:41:10 am »
After a day of building breaking installing uninstalling and generally instability of lazarus building process I think I have finally managed to make a breakthrough on the subject. I'm at a point where I can at least show an assembly based call stack and get a meaningful message out of this mess and the message leads to some the variants unit and some kind of conversion process failing.

I'm still trying to get fpc to compile with debug info so I can get a more meaningful call stack and see what is going on but I'm in a good path so far. I don't know this builting from source process gives me the creeps I'm uneasy all day long I'm never gonna get use to it. oh well, the battle must go on, back to my building process.
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

codifies

  • Jr. Member
  • **
  • Posts: 98
    • bedroomcoders
Re: Lookup fields do not return data.
« Reply #44 on: September 16, 2012, 04:09:53 am »
Stick with it!

I'm so desperate I'm considering booting windows for the first time in months to see if its any different there!  8-)

For me evething works even an uncached lookup just doesn't show cell contents but does drop down and edit. Its only as soon as I enable look up cache

I'm seeing this with 64bit Laz 1.0 and 1.1 with fpc 2.6
on Ubuntu 12.04 using MySQL 5.1 connector or postgres connector....
Lazarus 2.3.0 r3945f73 FPC 3.2.0 x86_64-linux-gtk2

 

TinyPortal © 2005-2018