LookupKeyFields

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
darkbrain
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 28.12.2005, 11:56

LookupKeyFields

Post by darkbrain »

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
MarkusD
Zeos Dev Team
Zeos Dev Team
Posts: 20
Joined: 28.08.2005, 03:40
Location: Ingolstadt

Post by MarkusD »

Hi DarkBrain,

it should work as you described, but a little bit more information would be useful:

What DB?
What Version of DB?

I suppose you are using ZeosLib 6.5.1?

What is your failing line of code?

Best Regards,
Markus Dütting
darkbrain
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 28.12.2005, 11:56

Post by darkbrain »

MarkusD wrote:Hi DarkBrain,

it should work as you described, but a little bit more information would be useful:

What DB?
What Version of DB?
Firebird 1.5 for windows
MarkusD wrote: I suppose you are using ZeosLib 6.5.1?
Yep, are there some patch? Where?
MarkusD wrote: What is your failing line of code?
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 .
My search fields are integer and the result one is a string.
MarkusD wrote: Best Regards,
Markus Dütting
Tnx,
DarkBrain
darkbrain
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 28.12.2005, 11:56

Post by darkbrain »

I can't find it. Ah if it can help, the exception is reised in a loop and it doesn't end. Where i should look to trace the zeoslib code?

tnx,
DarkBrain
Woodzzter
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 24.10.2005, 05:38

Post by Woodzzter »

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!)
darkbrain
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 28.12.2005, 11:56

Post by darkbrain »

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.
Thanks for your tips, it's very usefull!!!
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
:shock: :shock: :shock: :shock:

Any suggestion? (other than use only one keyfield)

bye,
DarkBrain
MarkusD
Zeos Dev Team
Zeos Dev Team
Posts: 20
Joined: 28.08.2005, 03:40
Location: Ingolstadt

Post by MarkusD »

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
Post Reply