i use delphi xe2 with zeos 7.0.4 without problems.
Now i update to delphi 10.4, and download the 7.2.6.1 version to compile my program. But on run, zeos raise an exception that i can not understand: "Parameter Cannot Be Derived from SQL Statements With Sub-select Queries".
This is my query (SQLServer):
Code: Select all
select * from tbparametro with (nolock)
where
(tbparametro.idempresa = :pidempresa and tbparametro.idunidade = :pidunidade) and
(idparametro = :pidparametro or idparametro in (
select idparametro from tbhstparam with (nolock)
where idempresa = :pidempresa and
idunidade = :pidunidade and
idcolaborador = :pidcolaborador and
((inicio < :pdini and fim is null) or
(:pdini between inicio and fim) or
(:pdfim between inicio and fim) or
(inicio between :pdini and :pdfim and fim between :pdini and :pdfim) or
(:pdfim > inicio and fim is null) )
union all
select idparametro from tbparamdia with (nolock) where
idempresa = :pidempresa and
idcolaborador = :pidcolaborador and
dia between :pdini and :pdfim
)
)
Code: Select all
procedure RefreshFromADO;
var
I: Integer;
Parameter: _Parameter;
begin
with AdoCommand do
try
Parameters.Refresh; <<<<<<<<<<<<<<<<<< THIS LINE
for I := 0 to Parameters.Count - 1 do
with Parameters[I] do
begin
{...}
Someone can help me!?
Thanks!