View Issue Details

IDProjectCategoryView StatusLast Update
0013395FPCDatabasepublic2011-10-15 18:03
ReporterLeslie Kaye Assigned ToJoost van der Sluis  
Status resolvedResolutionsuspended 
Product Version2.2.5 
Summary0013395: TField lookups error with multiple key fields
DescriptionWith a lookup field (FieldKind = fkLookup) multiple errors occur if there is more than one field listed in TField.KeyFields and TField.LookupKeyFields
for instance
"Invalid variant operation Array of Variant = Array of Variant"
"Field not found" in dataset when it does.

Different errors may be achieved by setting TField.LookupCache to True or to False
Additional InformationI attach a test project
Dbf1 has fields containing 2 char language IDs, month numbers and the month name according to the language and month number
Dbf2 contains a lookup field MONTH_NA which should return the month name according to language and month number data fields in Dbf2
Setting the lookup keys either to language or to month number works as expected. Set both language and month number as keys then errors occur.

I notice in the TLookupList implementation there are instances of:
V1 = V2
to test equality of variants .. the code should be
(I am not sure whether this works where the variant is an array maybe you have to test each element)
TagsNo tags attached.
Fixed in Revision
Attached Files


2009-03-25 10:40


DBLookupFieldTest.ZIP (166,737 bytes)

Joost van der Sluis

2009-04-09 22:51

manager   ~0026684

This is a TDbf-bug, which is a separate package which we only re-distribute. You can find the package here:


2011-10-15 18:03

administrator   ~0053017

TDBF has been abandoned by its maintainer and is no longer supported by the FPC team (the unit is still available, but with a deprecation warning explaining the situation).

You may be able to get further help from other users on the tdbf forum at

Issue History

Date Modified Username Field Change
2009-03-25 10:40 Leslie Kaye New Issue
2009-03-25 10:40 Leslie Kaye File Added: DBLookupFieldTest.ZIP
2009-03-25 11:01 Jonas Maebe FPCOldBugId => 0
2009-03-25 11:01 Jonas Maebe Category FCL => Database Components
2009-03-25 11:01 Jonas Maebe Status new => assigned
2009-03-25 11:01 Jonas Maebe Assigned To => Joost van der Sluis
2009-04-09 22:51 Joost van der Sluis Note Added: 0026684
2011-10-15 18:03 Florian Status assigned => resolved
2011-10-15 18:03 Florian Resolution open => suspended
2011-10-15 18:03 Florian Note Added: 0053017