Locate Nearest Problem

Locate Nearest Problem

Postby kenspc » Mon 22 Aug 2005 01:31

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
kenspc
 
Posts: 4
Joined: Mon 22 Aug 2005 01:25

locate for mysql

Postby mshafroth » Mon 22 Aug 2005 19:59

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.
mshafroth
 

Postby Ikar » Tue 23 Aug 2005 14:53

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.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby kenspc » Wed 24 Aug 2005 02:16

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...
kenspc
 
Posts: 4
Joined: Mon 22 Aug 2005 01:25

Postby Ikar » Thu 25 Aug 2005 09:12

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
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby kenspc » Tue 18 Oct 2005 07:25

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?
kenspc
 
Posts: 4
Joined: Mon 22 Aug 2005 01:25

Postby Ikar » Tue 18 Oct 2005 11:12

Build with this fix was released more than month ago. You can download it right now.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby kenspc » Wed 19 Oct 2005 09:53

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.
kenspc
 
Posts: 4
Joined: Mon 22 Aug 2005 01:25

Postby swierzbicki » Wed 19 Oct 2005 13:00

I guess that Ikar was talking about v4.x
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Postby Guest » Thu 20 Oct 2005 10:27

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
Guest
 

Postby Ikar » Thu 20 Oct 2005 12:49

Are you user of Pro version? If yes, please send us (mydac*crlab*com) your license number and we will send hotfix to you.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby tmliaw » Fri 21 Oct 2005 03:56

Thanks, I just decided to upgrade to use version 4.0 instead.
tmliaw
 
Posts: 3
Joined: Thu 04 Nov 2004 08:51
Location: Malaysia


Return to MySQL Data Access Components