locate with 2 fields doesn't work

Discussion of open issues, suggestions and bugs regarding Virtual Data Access Components for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 6
Joined: Tue 06 Nov 2007 17:17

locate with 2 fields doesn't work

Post by johnkuiper » Mon 09 Jun 2008 14:35

Normally I use only one key to locate a record.
Now I have to find a record with two fields.
This is what I use

Code: Select all

if Virtualtable.Locate('programma_id, lijstnummer',vararrayof([StrProgrid,IntLijstnr]),[])
This occurs an error, because the second field is not found. But the fields are created (seen with virtualtable.getfieldnames).

Is this a bug. Is there another way to find the record except the filter?

Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 10 Jun 2008 07:14

You should split fields in the field list with a semicolon, not with a comma:

Code: Select all

if Virtualtable.Locate('programma_id; lijstnummer',vararrayof([StrProgrid,IntLijstnr]),[]) 

Posts: 28
Joined: Thu 20 Dec 2007 14:48

Post by jkuiper_them » Tue 10 Jun 2008 08:30

Sorry :oops:

Normally I'm using one field to find.

Post Reply