Hi,
After install MyDAC 5.20.0.11 for Delphi 5, when i try use
Functions Locate or LooKup and the result is the 1st line in
dataset, this functions doesn't work. What's happen?
Functions Locate or LooKup
Hi Antaeus,
My problem occurs when I try to execute one lookup in the below described structure. In the VarArrayOf elements, when i have in wnsubit
variable a value number 1 (one) , his don't works, but using others values (like a 2) his works fine.
This same behavior occurs using a Locate function
Tks,
My problem occurs when I try to execute one lookup in the below described structure. In the VarArrayOf elements, when i have in wnsubit
variable a value number 1 (one) , his don't works, but using others values (like a 2) his works fine.
Code: Select all
ndatamod.NvouchBkn.Value := ndatamod.Ninvhot.LookUp('npasta;item;subit',VarArrayOf([ndatamod.ninvoicnpasta.Value,ndatamod.ninvoiciteste.Value,wnsubit]),'BKN');
CREATE TABLE `ninvhot` (
`Npasta` int(6) NOT NULL default '0',
`Item` int(3) NOT NULL default '0',
`Subit` int(3) NOT NULL default '0',
`Qtd` int(3) default NULL,
`Quarto` char(1) character set latin1 default NULL,
`Npax` int(3) default NULL,
PRIMARY KEY (`Npasta`,`Item`,`Subit`),
UNIQUE KEY `ninvhot` (`Npasta`,`Item`,`Subit`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Data in table
Npasta Item Subit Qtd Quarto Npax
541570 1 1 1 2
541570 2 1 1 2
This same behavior occurs using a Locate function
Code: Select all
if ndatamod.Ninvhot.Locate('npasta;item;subit',VarArrayOf([ndatamod.ninvoicnpasta.Value,ndatamod.ninvoiciteste.Value,wnsubit]),[]) then
begin
....
end;
Thank you for this explanation. I used it to reproduce the problem, but the sample I've created works with no problems. If the wnsubit variable equals to 1 (one), both records can be found for data you posted. The functions cannot find records for other values of wnsubit on this data, as it is expected.
Please prepare a complete small sample that reproduces the problem.
Please prepare a complete small sample that reproduces the problem.