Query.Params.count differs between BDE and UniDAC
Posted: Thu 21 Apr 2016 09:15
I hope the subject is okay. I'am porting a very old Delphi 4 with BDE Project to XE7 with UniDAC.
And now i run into a the following range check error.
The original code is like this sample
But with UniDac this works no more, because the TUniQuery says correctly that query1.params.count = 1 and not 2.
My question now is, can i change the behavior of UniDac or do i have to check all these paramcounts and eliminate the duplicates?
I know option two is the better/correct way, but there is plenty of this kind of code in the project.

And now i run into a the following range check error.
The original code is like this sample
Code: Select all
with query1 do
begin
sql.add('SELECT foo, bar from ( ');
sql.add(' SELECT foo, bar FROM TABLE1 WHERE xyz = :p1 ');
sql.add(' UNION ALL ');
sql.add(' SELECT foo, bar FROM TABLE2 WHERE XYZ = :p1 ) ');
params[0].asString := edit1.text;
params[1].asString := edit1.text;
end;
My question now is, can i change the behavior of UniDac or do i have to check all these paramcounts and eliminate the duplicates?
I know option two is the better/correct way, but there is plenty of this kind of code in the project.

