Hi
With Zeos 8.0, I found that the TZQuery.Locate method with loPartialKey doesn't work anymore as usual.
At least using Ubuntu 24.04, Lazarus 3.6, and MariaDb Ver 15.1 Distrib 10.11.8-MariaDB, for debian-linux-gnu (x86_64)
Unfortunately, I can't post on the ZeosLib forum (blocked, unable to access sourceforge.io) and don't find a related post elsewhere.
But I don't know if the issue is related to ZeosLib or Lazarus...
Problem is :
When the first characters of an existing key are entered, the result of Locate returns false (and the position in the Dataset don't change).
When a full existing key is entered, the Locate returns true and position is changed, as expected.
Looks like [loPartialKey] is ignored.
I'm sure that it was ok with Zeos 7 and the same code and configuration.
I can easily reproduce with this code example (only one string field).
procedure TForm1.Edit1Change(Sender: TObject);
begin
if ZreadonlyQuery1.Locate ('Account', edit1.Text, [loPartialKey] ) then
caption := 'found'
else
caption := 'not found';
end;
I have attached the full Lazarus project.
Enter the name, username and password of your database in Zconnection1, and
CREATE TABLE Accounts ( Account VARCHAR(10) NOT NULL );
INSERT INTO Accounts VALUES ('1000'), ('1005'), ('2000');
Or you can adapt the code to an existing table...
Any ideas or workaround ?