0

I'm using Delphi XE2 and I'm having problems with TClientDataset.Locate method. It will only locate if loPartialKey is passed as param. In other case, it will not find the record, even though the record definitely exists. Here is a code snippet:

result := lSysEq.Locate('IDIV;CODE_EQ',VarArrayOf([aDiv,aEqCode]),[]));

Where aDiv and aEqCode are string types and lSysEq is the TClientDataset. I don't believe I'm doing anything wrong and I've broken down to the most basic application. Still I cannot locate the proper record.

EMBarbosa
  • 1,473
  • 1
  • 22
  • 76
lucas
  • 47
  • 6
  • You are going to need to provide some more information and some sample data that fails. Don't assume that the lookup is wrong. If it matches on a partial key locate, then assume there are extra chars on the end of CODE_EQ. For example, if you could have untrimmed data that came out of a fixed length database field. You could be overlooking spaces that are hard to see at the end, and they would cause a non-partial match to fail. – Mark Elder Dec 20 '17 at 19:40
  • Have you tried adding loCaseInsensitive option? – Alec Dec 21 '17 at 07:44
  • What is the record you can't find? – EMBarbosa Apr 20 '18 at 17:48

0 Answers0