Parameter Not Found

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
jackylau
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 13.08.2019, 03:52
Location: Hong Kong

Parameter Not Found

Post by jackylau »

Hi,
I found that the same SQL statement with parameter behavior was worked differently between Delphi 10.2 & Delphi 2009.
It works on Delphi 10.2 without any problem, but an exception "Parameter Not Found" was though on Delphi 2009 environment.
The SQL statement is the same, How to fix this?

Background
Zeos 7.2.4-stable
Delphi 2009 and Delphi 10.2

SQL
SELECT * FROM users WHERE username = :username;

Thanks & Regards
Jacky
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1999
Joined: 17.01.2011, 14:17

Re: Parameter Not Found

Post by marsupilami »

Hello Jacky,

I split this topic from http://zeoslib.sourceforge.net/viewtopi ... 40&t=49966 because it was a very old thread.

Could you provide a minimum working example that demonstrates the problem? Also a database script and the database you use (MySQL 5.6, Firebird 3.0, ...) would be of great help to reproduce the problem.

Best regards,

Jan
jackylau
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 13.08.2019, 03:52
Location: Hong Kong

Re: Parameter Not Found

Post by jackylau »

Thank you, Jan.
I'm using postgres database (version 8.4 & 11 both not working) and Delphi 2009.

Steps to reproduce
DB Script

Code: Select all

CREATE TABLE sys_users (
  id SERIAL PRIMARY KEY,
  login VARCHAR(50),
  password VARCHAR(50)
);
INSERT INTO sys_users (login, password) VALUES ('TEST', 'TEST');
Delphi 2009
  • Create a delphi 2009 project
  • Place ZConnection component and setup the connection.
  • Place ZQuery component and SQL.Text

    Code: Select all

    SELECT * FROM sys_users WHERE login = :login
Results
Finally, an error was through when set ZQuery.Active = true, and you will find the parameters cannot be added.

Please let me know if any information need to provide would help to resolve the problems, thank you.
You do not have the required permissions to view the files attached to this post.
jackylau
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 13.08.2019, 03:52
Location: Hong Kong

Re: Parameter Not Found

Post by jackylau »

Suspect the problem may cause by Windows XP environment.
I tried to install Delphi 2009 + Zeoslib 7.2.4-stable in Windows 7, the error cannot reproduce, any idea?
miab3
Zeos Test Team
Zeos Test Team
Posts: 1314
Joined: 11.05.2012, 12:32
Location: Poland

Re: Parameter Not Found

Post by miab3 »

Code: Select all

procedure TForm2.btn1Click(Sender: TObject);
begin
ZQuery1.ParamByName('login').AsString:='MYlogin';
ZQuery1.Open;
end;
Michal
jackylau
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 13.08.2019, 03:52
Location: Hong Kong

Re: Parameter Not Found

Post by jackylau »

Hi Michal,
Your code is correct, but it didn't help to solve the problem.
Because the problem is while using "Windows XP" + Delphi 2009 + Zeoslib 7.2.4-stable environment, a syntax error caused the Params object couldn't be added correctly.
The same way in "Winsows 7" + Delphi 2009 + Zeoslib 7.2.4-stable environment works.
Attached two screen capture for your reference to compare the differences (highlighted in red).

Thanks & Regards
Jacky
You do not have the required permissions to view the files attached to this post.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1999
Joined: 17.01.2011, 14:17

Re: Parameter Not Found

Post by marsupilami »

Hello Jacky,

could you please try if the current 7.2-fixes branch from SVN solves your problem? I seem to remember a similar problem was solved for a different user in the past.

Best regards,

Jan
jackylau
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 13.08.2019, 03:52
Location: Hong Kong

Re: Parameter Not Found

Post by jackylau »

Hi Jan,
I'm not sure am I using the right branch to test [https://sourceforge.net/p/zeoslib/code- ... 2-patches/], the version is 7.2.5-rc.
If yes, the problem still exists.
The similar issue might be this thread http://zeoslib.sourceforge.net/viewtopi ... 40&t=49966 ?
I found that this issue quite specifies happen on Windows XP environment. Because I've tried Windows 7 + Delphi 2009 + Zeos 7.2.4 without problems, but unfortunately the existing project only can run on Windows XP + Delphi 2009 (Currently using 7.0.0-dev also no problem found)

Thanks & Regards
Jacky
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1999
Joined: 17.01.2011, 14:17

Re: Parameter Not Found

Post by marsupilami »

Hello Jacky,

to see wether this really is a problem of Windows XP, could you try to compile the program on Windows 7 and see if that compiled program works correctly on Windows XP?

Best regards,

Jan
Post Reply