Page 1 of 1

Locate Nearest Problem

Posted: Mon 22 Aug 2005 01:31
by kenspc
i get the problem with locate nearest...

pls see my code at below:

Database Structure:

# Create Database [Test], If not exist.
CREATE DATABASE IF NOT EXISTS Test;

# Use Database [Test]
USE Test;

# 1. Vehical Master File
CREATE TABLE IF NOT EXISTS Vehicle (
Registration VARCHAR(20) NOT NULL,
OwnerName VARCHAR(50) NOT NULL,
Make VARCHAR(30),
Model VARCHAR(30),
PRIMARY KEY (Registration)
);

# Insert Data.........
INSERT INTO Vehicle VALUES('MK--110', 'KEN', 'TOYOTA', '1.6A');
INSERT INTO Vehicle VALUES('MK--119', 'PETTY', 'KIA', '1.6A');
INSERT INTO Vehicle VALUES('MK-1184M-12', 'LOU', 'FORD', '1.6A');

Test.pas:
procedure TForm1.Button1Click(Sender: TObject);
begin
MyTable1.LocateEx('Registration', 'MK-1184M-11', [lxNearest]);
end;

Problem:
The cursor goto MK--119, no MK-1184M-11

Pls advise, Thanks

locate for mysql

Posted: Mon 22 Aug 2005 19:59
by mshafroth
I find that locateex does not produce the right result when the index has a key with a '-' in it before the desired key. It seems to stop at the first key with a '-' before the desired key. Thus locating 'Rock County' stops at 'R-M' even when 'Rock County' exists.

Posted: Tue 23 Aug 2005 14:53
by Ikar
lxNearest doesn't try to find a record most similar by spelling or pronunciation. lxNearest search for the nearest record greater than the specified value. In fact, using lxNearest makes sense only for searching in ascending ordered DataSet.

Posted: Wed 24 Aug 2005 02:16
by kenspc
yes, i have set the order by Registration
and the sorting will be:

MK--110
MK--119
MK-1184M-12

I locate nearest the 'MK-1184M-12', but the cursor stop on MK--119, no 'MK-1184M-12'.
my customer question me, i can't answer...

Posted: Thu 25 Aug 2005 09:12
by Ikar
Thank you for information.
We reproduced your problem and fixed it. This fix will be included in the next MyDAC build. It will be available in about three weeks. Please look forward for announcments at the forum

Posted: Tue 18 Oct 2005 07:25
by kenspc
May i know, what status of this problem, are it fixed?

when can i download the fixed MyDAC?

sorry, my customer always complaint me.

can fix this problem quickly?

Posted: Tue 18 Oct 2005 11:12
by Ikar
Build with this fix was released more than month ago. You can download it right now.

Posted: Wed 19 Oct 2005 09:53
by kenspc
The latest version i downloaded on your website (mydac3pro) is 3.55.0.23 which is dated 2005-08-02.
the version i use is for Delphi 5.

This version(3.55.0.23) i use still have a same problem. Pls advice.

Posted: Wed 19 Oct 2005 13:00
by swierzbicki
I guess that Ikar was talking about v4.x

Posted: Thu 20 Oct 2005 10:27
by Guest
Since you have fixed the problem in 4.0, aren't you going to do the same for version 3.x? Please help, my customer is really up to my neck now. I will appreciate very much if you can post a new minor update for version 3.x for this bug. Thanks

Posted: Thu 20 Oct 2005 12:49
by Ikar
Are you user of Pro version? If yes, please send us (mydac*crlab*com) your license number and we will send hotfix to you.

Posted: Fri 21 Oct 2005 03:56
by tmliaw
Thanks, I just decided to upgrade to use version 4.0 instead.