Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: XE2 - TClientDataset.Locate



Permlink Replies: 0
stephen lukacs

Posts: 13
Registered: 6/18/12
XE2 - TClientDataset.Locate
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 19, 2017 6:33 AM
hello one and all,

i'm using Delphi XE2. i know its an old version, i'm trying to fix some very old code. however, i'm having a problems with TClientDataset.Locate. it will only locate if loPartialKey is active. if it isn't active, 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]),[]));


OR, even simpler.

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

where aDiv and aEqCode are string types and lSysEq is of TClientDataset. i don't believe i'm doing anything wrong and i've broken down to the most basic application and i still can not locate the proper record.

i have traced the code down into the TCustomClientDataSet.LocateRecord under Datasnap.DBClient, right around the line containing "Status := FDSCursor.LocateWithFilter" where Status = 8710 when it is not found. If loPartialKey is used, Status will equal 0, which makes sense.

so why doesn't locate find the record with loPartialKey absent?

thank you in advance, lucas

Edited by: stephen lukacs on Dec 19, 2017 6:33 AM

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02