Data clear after canceling ZQuery
Posted: 02.05.2023, 22:15
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