Page 1 of 1

Incompatible types: 'TZConnection' and 'TZAbstractConnection'

Posted: 13.02.2019, 03:09
by Delphiwar99
I have the following funtion working in Delphi2010 with zeos 6.6.5

Code: Select all

function zIncCodeByYear
(zQry : TZquery; sCampo : string; iDigit : ShortInt = 8 ): String;
var
  zConLocal, zConOriginal : TZConnection;
begin
  bActive := zQry.Active;
  zConOriginal := zQry.Connection;
  ...
Now I'm migrating to Delphi Tokyo with zeos 7.2.4 and i get the followin error when i try to compile

[dcc32 Error] zeosfuncs.pas(267): E2010 Incompatible types: 'TZConnection' and 'TZAbstractConnection'
[dcc32 Fatal Error] Myfuncs.pas(162): F2063 Could not compile used unit 'zeosfuncs.pas'

Any Help?
Thanks!

Re: Incompatible types: 'TZConnection' and 'TZAbstractConnection'

Posted: 14.02.2019, 09:45
by marsupilami
Hello and welcome to the Forums ;)

Please replace

Code: Select all

zConLocal, zConOriginal : TZConnection;
with

Code: Select all

zConLocal, zConOriginal : TZAbstractConnection;
With Zeos 7.0 a new connection type for a connection pool was introduced. Because of this the components now have properties of the type TZAbstractConnection instead of TZConnection.

Best regards,

Jan