Data clear after canceling ZQuery
-
- Fresh Boarder
- Posts: 19
- Joined: 01.05.2023, 15:41
Data clear after canceling ZQuery
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:
I also created a test database with just one table named tbl_test.
I also put some rows in the table for the example.
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.
Until then, everything is normal. On the EDIT and CANCEL buttons I have simple codes. Just to edit the record and cancel.
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.
After adding this line, if I click on the Edit button and then on the Cancel button the content of DBEdit1 is erased (HELLO).
This behavior happened only in the new Zeos 8.0 + Delphi 11.2 scenario.
Can anybody help me?
Thx
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:
I also created a test database with just one table named tbl_test.
I also put some rows in the table for the example.
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.
Until then, everything is normal. On the EDIT and CANCEL buttons I have simple codes. Just to edit the record and cancel.
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.
After adding this line, if I click on the Edit button and then on the Cancel button the content of DBEdit1 is erased (HELLO).
This behavior happened only in the new Zeos 8.0 + Delphi 11.2 scenario.
Can anybody help me?
Thx
-
- Platinum Boarder
- Posts: 1939
- Joined: 17.01.2011, 14:17
Re: Data clear after canceling ZQuery
PLease upload your test project, so we can test it. I don't want to copy the code from pictures by typing everything myself.
Re: Data clear after canceling ZQuery
And where is ZQuery1.Post?
Michal
Michal
-
- Fresh Boarder
- Posts: 19
- Joined: 01.05.2023, 15:41
Re: Data clear after canceling ZQuery
Sorry!!! :-Dmarsupilami 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.
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.
-
- Fresh Boarder
- Posts: 19
- Joined: 01.05.2023, 15:41
-
- Platinum Boarder
- Posts: 1939
- Joined: 17.01.2011, 14:17
Re: Data clear after canceling ZQuery
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.
I have no clue yet what the problem is.
Re: Data clear after canceling ZQuery
ZConnection1.Connected:=FALSE;
ZQuery1.Open;
Shows old value
Michal
ZQuery1.Open;
Shows old value
Michal
-
- Fresh Boarder
- Posts: 19
- Joined: 01.05.2023, 15:41
Re: Data clear after canceling ZQuery
Hi,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.
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.
-
- Fresh Boarder
- Posts: 19
- Joined: 01.05.2023, 15:41
Re: Data clear after canceling ZQuery
Hi marsupilami,
How are you?
Any news about this bug?
How are you?
Any news about this bug?