ZQuery RefreshCurrentRow

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Bill74
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 10.12.2016, 09:43

ZQuery RefreshCurrentRow

Postby Bill74 » 28.03.2018, 09:17

Hello,

I am developing under Delphi. In my application, there are a ZQuery1 and a ZQuery2.
the role of this ZQuery2 is to update the ZQuery1. To display the changes to the user of my application, I have to go through "ZQuery1 .Refresh".
The ZQuery2 contains 300000 records, so it takes several seconds to display these changes.
I want to display only the update of row without going through a "refresh" of the ZQuery2 .
I saw that there is the property "RefreshCurrentRow". I wrote :
"ZTable1.RefreshCurrentRow (FALSE);"
But, there is no visible change.

- ZQuery1 SQL (Select... From...).
- ZQuery2 SQL (Update... Set...).

How to display the update of a one row of a ZQuery1 please?

Thank you

Delphi + ZEOSDBO-7.2.4-stable.

marsupilami
Gold Boarder
Gold Boarder
Posts: 671
Joined: 17.01.2011, 14:17

Re: ZQuery RefreshCurrentRow

Postby marsupilami » 28.03.2018, 09:45

Hello Bill,

why don't you just do the changes in ZQuery1?

Code: Select all

ZQuery1.Edit;
ZQuery1.FieldByName('foo').AsString := myStringValue;
ZQuery1.FieldByName('bar').AsInteger := MyIntegerValue;
ZQuery1.Post;

This way ZQuer1 always will know the current state of the record?

Best regards,

Jan

Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 120
Joined: 08.05.2014, 12:08

Re: ZQuery RefreshCurrentRow

Postby Fr0sT » 28.03.2018, 14:14

Hmm, how did you manage to execute this method? I receive "The refreshrow method is only supported with an update object." with query as well as table.
Anyway +1 for trying to implement this method, it could be very useful.

Bill74
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 10.12.2016, 09:43

Re: ZQuery RefreshCurrentRow

Postby Bill74 » 28.03.2018, 19:59

Hello,
I thank you for your answer.

- marsupilami:
yes, your code does the job but I do not want to go through:
"Edit" and after "Post" because my application works on LAN and many users are connected to it, and for not having much charge in the LAN.

- Fr0sT :
I execute this method : TQuery (with "OpdateObjet" propriety to "ZUpdateSQL") + ZUpdateSQL.
This is normally compiled but, there is no refresh of the Query.

Best regards.

Bill

Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 120
Joined: 08.05.2014, 12:08

Re: ZQuery RefreshCurrentRow

Postby Fr0sT » 29.03.2018, 07:51

Bill74 wrote:I execute this method : TQuery (with "OpdateObjet" propriety to "ZUpdateSQL") + ZUpdateSQL.
This is normally compiled but, there is no refresh of the Query.

That's weird, things should work. More to say, from the 1st sight I see no reasons why this couldn't work even without UpdateObject


Return to “ZeosLib 7.2 Forum”

Who is online

Users browsing this forum: No registered users and 1 guest