I noticed that changes in dbmemo are not saved when I moved to another record (in dbgrid). This happens if I am using Tzquery/TzMemtable (but not when I am using TMemDataset or Tdbf component).
Attached is the demo file.
dbmemo/dbgrid problem
dbmemo/dbgrid problem
You do not have the required permissions to view the files attached to this post.
Re: dbmemo/dbgrid problem
Hi,
As if change detection for the memo field itself is missing.
Michał
As if change detection for the memo field itself is missing.
Michał
Re: dbmemo/dbgrid problem
Ya, if I have add a line 'fields[x].asString := fields[x].asString (x is another field) then the memofield will be updated.
Is there a bug somewhere?
Is there a bug somewhere?
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: dbmemo/dbgrid problem
You mean set the DisableZFields ? I tried ...same outcome whether disableZFields is True or False. The change in memofield would not be posted unless another field is edited.marsupilami wrote: ↑13.12.2021, 11:46 Hmmm - could you please check what happens if you disable the ZFields? I am not sure wether that has to happen in the Zeos.inc or in the properties of the dataset though...
Re: dbmemo/dbgrid problem
Issue seems to be Lazarus-specific, I can not reproduce the issue with latest Zeos from Git using D10.4 and D7.
Upon starting to type, ZMemTable properly fires both .BeforeEdit & .AfterEdit events, upon changing records in the DBGrid both .BeforePost and .AfterPost is fired. Modified data is correctly retained in ZMemTable.
As I have no Lazarus experience and therefore none installed I can not debug this. If you feel adventurous, this is what I'd do:
Upon starting to type, ZMemTable properly fires both .BeforeEdit & .AfterEdit events, upon changing records in the DBGrid both .BeforePost and .AfterPost is fired. Modified data is correctly retained in ZMemTable.
As I have no Lazarus experience and therefore none installed I can not debug this. If you feel adventurous, this is what I'd do:
- Put a button on the form with the following code:
Code: Select all
ZMemTable1.Edit; Try If ZMemTable1.FieldByName('MemoField').IsNull Then ZMemTable1.FieldByName('MemoField').AsString := 'Test' Else ZMemTable1.FieldByName('MemoField').Clear; Finally ZMemTable1.Post; End;
- Create a dummy .BeforeEdit and .BeforePost event handler and put breakpoints in them
- Check which one is fired when editing manually
- Click on the button. When the execution stops in the event handler which did NOT fire manually, go back in the stacktrace and put some breakpoints in. Use step over to find the condition which eventually bocks the call
- Rinse and repeat until culprit is found
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47