Working with Locate()

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
FCS
Posts: 176
Joined: Sat 23 Feb 2013 18:46

Working with Locate()

Post by FCS » Thu 19 Nov 2015 06:57

Hello,

I have a query which returns records with data sorted on a column like this:
aaaa
aaaa
bbbbbb
bbbbbb
bbbbbb
cccccc
cccccc
cccccc

Now I want iterate through all records containing the "bbbbb" value. To get the first "bbbbb" I can use the Locate function, but how to get next records with the "bbbbb" value?

Regards
Michal

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Working with Locate()

Post by AlexP » Thu 19 Nov 2015 07:11

Hello,

To locate the next/previous record, you can use the LocateEx method, where you need to specify the lxNext/lxUp search direction as the last parameter:

Code: Select all

UniQuery1.LocateEx('F_NAME', 'bbbbbb', [lxNext]);

FCS
Posts: 176
Joined: Sat 23 Feb 2013 18:46

Re: Working with Locate()

Post by FCS » Thu 19 Nov 2015 07:32

Thanks

Michal

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Working with Locate()

Post by AlexP » Thu 19 Nov 2015 07:54

You are welcome. Feel free to contact us if you have any further questions.

Post Reply