Data clear after canceling ZQuery

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
atendimentobed
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 01.05.2023, 15:41

Data clear after canceling ZQuery

Post by atendimentobed »

Hi,

After migrating a project to Delphi 11.2 + MySQL 5.0 + Zeos 8.0 I noticed a strange behavior that did not occur previously in the 7.1.4-stable version of Zeos used in Delphi 2010.

To make it easier, I reproduced the problem in a simple scenario. I created a new VCL project with just one form and the components below:
Image

I also created a test database with just one table named tbl_test.
Image

I also put some rows in the table for the example.
Image

ZQuery1 is linked to the tbl_test table, DataSource1 is linked to ZQuery1, ZQuery1 is pointed to ZUpdateSQL1 to execute the DML commands and DBEdit1 pointed to DataSource1, field name. A normal scenario.

I run the application and as expected the name appears correctly in DBEdit1.
Image

Until then, everything is normal. On the EDIT and CANCEL buttons I have simple codes. Just to edit the record and cancel.
Image

If I click on the Edit button and then on the Cancel button, the DBEdit continues to display the value (HELLO), as expected. But if I add the line below in the Edit code the problem happens.
Image

After adding this line, if I click on the Edit button and then on the Cancel button the content of DBEdit1 is erased (HELLO).
Image

This behavior happened only in the new Zeos 8.0 + Delphi 11.2 scenario.

Can anybody help me?

Thx
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: Data clear after canceling ZQuery

Post by marsupilami »

PLease upload your test project, so we can test it. I don't want to copy the code from pictures by typing everything myself. ;)
miab3
Zeos Test Team
Zeos Test Team
Posts: 1309
Joined: 11.05.2012, 12:32
Location: Poland

Re: Data clear after canceling ZQuery

Post by miab3 »

And where is ZQuery1.Post?

Michal
atendimentobed
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 01.05.2023, 15:41

Re: Data clear after canceling ZQuery

Post by atendimentobed »

marsupilami wrote: 03.05.2023, 08:33 PLease upload your test project, so we can test it. I don't want to copy the code from pictures by typing everything myself. ;)
Sorry!!! :-D

Project Delphi:
https://mega.nz/file/2AdyAKoJ#my7xnb2pO ... WJ0P93q4Z8

Script SQL:
https://mega.nz/file/HQswGJya#MtSUXlJQk ... FRsSYVb_zA
Last edited by atendimentobed on 05.05.2023, 14:13, edited 1 time in total.
atendimentobed
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 01.05.2023, 15:41

Re: Data clear after canceling ZQuery

Post by atendimentobed »

miab3 wrote: 03.05.2023, 10:44 And where is ZQuery1.Post?

Michal
Hi,

To simplify the explanation, I didn't put ZQuery1.Post in the example, because the problem happens only in ZQuery1.Cancel.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: Data clear after canceling ZQuery

Post by marsupilami »

I can confirm the bug. What's even more confusing: It doesn't happen when a DBGrid is connected to the Query.

I have no clue yet what the problem is.
miab3
Zeos Test Team
Zeos Test Team
Posts: 1309
Joined: 11.05.2012, 12:32
Location: Poland

Re: Data clear after canceling ZQuery

Post by miab3 »

ZConnection1.Connected:=FALSE;
ZQuery1.Open;

Shows old value

Michal
atendimentobed
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 01.05.2023, 15:41

Re: Data clear after canceling ZQuery

Post by atendimentobed »

marsupilami wrote: 04.05.2023, 06:13 I can confirm the bug. What's even more confusing: It doesn't happen when a DBGrid is connected to the Query.

I have no clue yet what the problem is.
Hi,

This is a pretty common scenario, a basic CRUD screen. But I couldn't find anyone else who reported this issue, that's why I opened this topic.
atendimentobed
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 01.05.2023, 15:41

Re: Data clear after canceling ZQuery

Post by atendimentobed »

Hi marsupilami,

How are you?

Any news about this bug?
Post Reply