What is wrong with this statement?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ccmcbride
Posts: 101
Joined: Tue 01 May 2007 16:36

What is wrong with this statement?

Post by ccmcbride » Wed 27 Jun 2007 01:34

function FindRec(aTable : tmsTable; const aKey : string; aField : string = 'UID') : boolean;
begin
if aTable.FieldByName(aField).AsString aKey then
result := aTable.Locate(aField, Variant(aKey), [foCaseInsensitive, foNoPartialCompare]) --> 'There is no overloaded version of 'locate' that be called with these parameters

else
result := true;
end;

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

Post by Antaeus » Wed 27 Jun 2007 08:23

You provided a wrong value to the Options parameter. It is of the TLocateOption type, and accepts only loCaseInsensitive and loPartialKey values.
You can find an example in the TMemDataSet.Locate topic of SDAC help.

Post Reply