[solved] A question and a proposed modification to the code
Moderators: gto, cipto_kh, EgonHugeist, mdaems
[solved] A question and a proposed modification to the code
Hi,
use Delphi since version 1 (almost 20 years) and the Zeos library is the library that I loved most. Thanks to Zeos, I was able to migrate my applications from BDE.
I have a small question for the group that writes and maintains Zeos.
In the unit ZDbcGenericResolver, in the procedure TZGenericCachedResolver.PostUpdates (...., there is this statement:
if (lValidateUpdateCount)
and (lUpdateCount <> 0) then ....
that, in my opinion, should be corrected:
if (lValidateUpdateCount)
and (lUpdateCount> 1) then ....
because, using the TzTable, often, happens that only 1 record meets the criteria and, in this case, the program exits with the exception:
0 record (s) updated. Only one record Should have been updated.
Every, when upgrading libraries Zeos, I have to change this line.
My question is:
where am I wrong?, and if I'm not mistaken you can accept my change?
Thanks to all the wonderful staff who gave us this wonderful jewel.
Mario Rossi.
use Delphi since version 1 (almost 20 years) and the Zeos library is the library that I loved most. Thanks to Zeos, I was able to migrate my applications from BDE.
I have a small question for the group that writes and maintains Zeos.
In the unit ZDbcGenericResolver, in the procedure TZGenericCachedResolver.PostUpdates (...., there is this statement:
if (lValidateUpdateCount)
and (lUpdateCount <> 0) then ....
that, in my opinion, should be corrected:
if (lValidateUpdateCount)
and (lUpdateCount> 1) then ....
because, using the TzTable, often, happens that only 1 record meets the criteria and, in this case, the program exits with the exception:
0 record (s) updated. Only one record Should have been updated.
Every, when upgrading libraries Zeos, I have to change this line.
My question is:
where am I wrong?, and if I'm not mistaken you can accept my change?
Thanks to all the wonderful staff who gave us this wonderful jewel.
Mario Rossi.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
mrossij,
hi thank's for asking instead of a bugreport (:
The solution is quiet simple:
TZDataSetComponent.Properties['ValidateUpdateCount'] := '-1' or 'OFF' or 'FALSE';
Each TZQuery, TZTable, TZReadOnlyQuery is checking that property first. Mostly the user doesn't change that behavior, so Zeos raises an exception because we expect an optimal ((: updatecount of 1.
hi thank's for asking instead of a bugreport (:
The solution is quiet simple:
TZDataSetComponent.Properties['ValidateUpdateCount'] := '-1' or 'OFF' or 'FALSE';
Each TZQuery, TZTable, TZReadOnlyQuery is checking that property first. Mostly the user doesn't change that behavior, so Zeos raises an exception because we expect an optimal ((: updatecount of 1.
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/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
mrossij,
TZReadOnlyQuery/TZTable/TZQuery.Properties = TStrings.
Click in your property editor on that property and type in:
ValidateUpdateCount=-1
or
ValidateUpdateCount=OFF
or
ValidateUpdateCount=FALSE
Hope you understand me now )):
TZReadOnlyQuery/TZTable/TZQuery.Properties = TStrings.
Click in your property editor on that property and type in:
ValidateUpdateCount=-1
or
ValidateUpdateCount=OFF
or
ValidateUpdateCount=FALSE
Hope you understand me now )):
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/
Very well, it works.
However, I think that I will continue to modify the source of the unit ZdbcGenericResolver because it is more easier for me.
My projects have dozens of tables into "Data Modules" and forms and I should specify this properties for each dataset.
Anyway, thanks for your appreciated collaboration and help.
However, I think that I will continue to modify the source of the unit ZdbcGenericResolver because it is more easier for me.
My projects have dozens of tables into "Data Modules" and forms and I should specify this properties for each dataset.
Anyway, thanks for your appreciated collaboration and help.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
mrossij,
no problem.
Hmm what about a difine for Zeos.inc? That could be commented by default and you simply uncomment it?
no problem.
Hmm what about a difine for Zeos.inc? That could be commented by default and you simply uncomment it?
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/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
mrossij,
you can do this on your side. I did it now on Zeos side.
I've added a {$IFDEF WITH_VALIDATE_UPDATE_COUNT} define to the Zeos.inc
Patch done Rev. 2007 \testing (SVN)
you can do this on your side. I did it now on Zeos side.
I've added a {$IFDEF WITH_VALIDATE_UPDATE_COUNT} define to the Zeos.inc
Patch done Rev. 2007 \testing (SVN)
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/