How to goto nearest?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
charin
Posts: 4
Joined: Thu 10 Nov 2011 17:20

How to goto nearest?

Post by charin » Sat 28 Apr 2012 11:15

I would like to search for nearest but following command it not working.
Anyone have solution for this?

with MyTable1 do begin
SetKey;
FieldByName('Company').AsString:=edSearch.text;
GotoNearest;
end;

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

Re: How to goto nearest?

Post by AlexP » Sat 28 Apr 2012 13:39

hello,

There is no GoToNearest method in MyDAC. Instead of it, you should use the Locate or LocateEx method.

Code: Select all

MyTable1.Locate('Company',edSearch.text,[]);

cybsistemas
Posts: 118
Joined: Mon 12 Sep 2005 17:31
Location: Argentina

Re: How to goto nearest?

Post by cybsistemas » Sat 28 Apr 2012 18:27

include memdata.dcu in the uses
MyTable1.LocateEx('Company',edSearch.text,[lxNearest])

charin
Posts: 4
Joined: Thu 10 Nov 2011 17:20

Re: How to goto nearest?

Post by charin » Sun 29 Apr 2012 04:16

Thanks, cybsistemas & AlexP it work very well.

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

Re: How to goto nearest?

Post by AlexP » Mon 30 Apr 2012 08:35

hello,

If you have any other questions, feel free to contact us.

Post Reply