Hi all,
After the last update of zeos (svn rev 6794), my project crashes with message "Invalid type cast"
in line 1734, file ZDatasetUtils
ConSettings := TZAbstractRODataset(THackParam(Param).DataSet).Connection.DbcConnection.GetConSettings;
the code that trigger the error is:
ZROQueryCodiciInterventi.ParamByName('FILTRO').AsString := s;
where s is a String
latest running version of zeos was 6758
thanks in advance for any advice,
renabor
FPC 3.2.1, Lazarus 2.0.10, Linux
Invalid type cast in file ZDatasetUtils
-
- Platinum Boarder
- Posts: 1962
- Joined: 17.01.2011, 14:17
Re: Invalid type cast in file ZDatasetUtils
Hello renabor,
thank you for the bug report. I created a bug report on Source Forge for this problem: https://sourceforge.net/p/zeoslib/tickets/440/
Currently I can only suggest to go back to the latest working version. A fix can take some weekes because nearly everybody is on holidays right now. You might want to subscribe to the sourceforge bug report.
Best regards,
Jan
thank you for the bug report. I created a bug report on Source Forge for this problem: https://sourceforge.net/p/zeoslib/tickets/440/
Currently I can only suggest to go back to the latest working version. A fix can take some weekes because nearly everybody is on holidays right now. You might want to subscribe to the sourceforge bug report.
Best regards,
Jan
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Invalid type cast in file ZDatasetUtils
Hello renabor,
that's weird, i can't see something wrong. So i added an assertiation See: https://sourceforge.net/p/zeoslib/code-0/6809/.
If the assertiation is triggered, than the DataSet of the Parameter is not an Descendant of the Zeos-TZAbstractRODataset.
So plz update. Is the assertiation triggered? What's the FieldType of the Parameter?
that's weird, i can't see something wrong. So i added an assertiation See: https://sourceforge.net/p/zeoslib/code-0/6809/.
If the assertiation is triggered, than the DataSet of the Parameter is not an Descendant of the Zeos-TZAbstractRODataset.
So plz update. Is the assertiation triggered? What's the FieldType of the Parameter?
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
Re: Invalid type cast in file ZDatasetUtils
Hello EgonHugeist,
the parameter is defined simply as:
sql:='select distinct codice_novo from oc_cup where codice_novo like (:FILTRO) order by codice_novo';
ZROQueryCodiciInterventi.SQL.Text:=SQL;
I've tried to compile the program with target Windows and it run fine!
Same code compiled with target Linux triggered the error.
Linux is case sensitive so I suppose the problem is related to the name of a unit, which mix of upper-lower case does not match corresponding name in the uses clause, or something similar
Best regards,
renabor
the parameter is defined simply as:
sql:='select distinct codice_novo from oc_cup where codice_novo like (:FILTRO) order by codice_novo';
ZROQueryCodiciInterventi.SQL.Text:=SQL;
I've tried to compile the program with target Windows and it run fine!
Same code compiled with target Linux triggered the error.
Linux is case sensitive so I suppose the problem is related to the name of a unit, which mix of upper-lower case does not match corresponding name in the uses clause, or something similar
Best regards,
renabor
-
- Platinum Boarder
- Posts: 1962
- Joined: 17.01.2011, 14:17
Re: Invalid type cast in file ZDatasetUtils
Hello renabor,
Also - usually the error message you posted happens at runtime. This is why we need a small sample program that can reproduce the error. Otherwise it will be hard to track down the problem. So:
- Please create a small sample program that reproduces the error.
- Please supply a create scrip that creates the necessary tables and inserts data that is needed for the program to run.
- Please tell us which database you use including version numbers for the client and the server.
Best regards,
Jan
Do you get this error during compile time or when you run the program? I wonder about this because we currently compile Zeos on Linux (FPC 3.0.4 / Lazarus 2.0.0 x86_64) on a regular basis as part of our automated tests. And we don't get errors during the compilation.renabor wrote: ↑11.09.2020, 07:25 I've tried to compile the program with target Windows and it run fine!
Same code compiled with target Linux triggered the error.
Linux is case sensitive so I suppose the problem is related to the name of a unit, which mix of upper-lower case does not match corresponding name in the uses clause, or something similar
Also - usually the error message you posted happens at runtime. This is why we need a small sample program that can reproduce the error. Otherwise it will be hard to track down the problem. So:
- Please create a small sample program that reproduces the error.
- Please supply a create scrip that creates the necessary tables and inserts data that is needed for the program to run.
- Please tell us which database you use including version numbers for the client and the server.
Best regards,
Jan
Re: Invalid type cast in file ZDatasetUtils
Hello marsupilami,
yes, problem occurs at runtime.
As you asked, I created a small program with all the code involved but I can't reproduce the error. The test program run as expected, so I think that somewhere in my code there is something bad.
Perhaps a lack of a parameter, or a parameter that is not needed, I don't know.
For now I've resolved switching back using filter instead of parameter,
thankyou anyway for all,
Best regards
renabor
yes, problem occurs at runtime.
As you asked, I created a small program with all the code involved but I can't reproduce the error. The test program run as expected, so I think that somewhere in my code there is something bad.
Perhaps a lack of a parameter, or a parameter that is not needed, I don't know.
For now I've resolved switching back using filter instead of parameter,
thankyou anyway for all,
Best regards
renabor