Hi all,
are LookupKeyFields and KeyFields capable of multiple fields to obtain a primary key to search into LookupDataSet? I'm using semicolon to separete them but a EDataBaseError is raised (Field not found)
thanks,
DarkBrain
LookupKeyFields
Moderators: gto, cipto_kh, EgonHugeist
Firebird 1.5 for windowsMarkusD wrote:Hi DarkBrain,
it should work as you described, but a little bit more information would be useful:
What DB?
What Version of DB?
Yep, are there some patch? Where?MarkusD wrote: I suppose you are using ZeosLib 6.5.1?
This is strange because my delphi7 doesn't show me which code line has raised the exception. The Exception is SFieldNotFound1 and can be raised from ZdbcInterbase6Utils:1420 or ZDbcASAUtils:481 .MarkusD wrote: What is your failing line of code?
My search fields are integer and the result one is a string.
Tnx,MarkusD wrote: Best Regards,
Markus Dütting
DarkBrain
To locate your line of code, download and install something like MadExcept which will trap the exception and also show you a call stack to locate the path to the exception.
Definitely a product worth purchasing (although for a non commercial product there is no fee to use it).This should definitely help you locate the error a lot easier.
(No - I do not have anything to do with the MadExcept product - I am just a user of it!)
Definitely a product worth purchasing (although for a non commercial product there is no fee to use it).This should definitely help you locate the error a lot easier.
(No - I do not have anything to do with the MadExcept product - I am just a user of it!)
Thanks for your tips, it's very usefull!!!Woodzzter wrote:To locate your line of code, download and install something like MadExcept which will trap the exception and also show you a call stack to locate the path to the exception.
Any here is what i found:
Following is the reply I got from someone at Borland about the
problem.
Dear xxx,
Thank you for submitting your bug report. It has been confirmed
that this is not a bug. Lookup controls do not currently handle
multiple field lookups. It is a feature that has been requested
by some others, but is not currently implemented in any versions
of Delphi.
Thank you.
Richard Ponton, Developer Support
Any suggestion? (other than use only one keyfield)
bye,
DarkBrain
Hello DarkBrain,
i thought you were using the Lookup or Locate method of a TDataSet. There you can use multiple fields seperated with semicolons.
You want to use a fkLookup field with multiple references?
The easiest way you can achive this imho would be using a calculated field ( FieldKind fkClalculated) and calling e.g. the Lookup method in the OnCalcFields event to populate it ( you can only change a calculated field there). But beware if you have AutoCalcFields activated then OnCalcFields is called quite often and can slow down your program quite easily ( as well as lookup fields btw). Especially if you aren't using a memory table ( e.g. kbmMemTable) for the lookup dataset. Anyway i couldn't get calculated fields correctly working without enabling AutoCalcFields ( Lookup Fields also don't working correctly without, at least in Delphi 4).
Best Regards,
Markus Dütting
i thought you were using the Lookup or Locate method of a TDataSet. There you can use multiple fields seperated with semicolons.
You want to use a fkLookup field with multiple references?
The easiest way you can achive this imho would be using a calculated field ( FieldKind fkClalculated) and calling e.g. the Lookup method in the OnCalcFields event to populate it ( you can only change a calculated field there). But beware if you have AutoCalcFields activated then OnCalcFields is called quite often and can slow down your program quite easily ( as well as lookup fields btw). Especially if you aren't using a memory table ( e.g. kbmMemTable) for the lookup dataset. Anyway i couldn't get calculated fields correctly working without enabling AutoCalcFields ( Lookup Fields also don't working correctly without, at least in Delphi 4).
Best Regards,
Markus Dütting