0

I'm porting a project from Delphi XE2 to Delphi 11, while keeping compatibility with the XE2 version. But when I open a data module in the XE2 IDE, an error message is shown: "Error reading IBQ.PrecommittedReads: Property PrecommittedReads doesn't exist".

I know, that the problem is caused by the new TIBCustomDataSet.PrecommittedReads property which was saved to the .DFM, and I already use DDevExtensions to avoid storing TDataModule.PixelsPerInch properties in the .DFM.

https://docwiki.embarcadero.com/Libraries/Alexandria/en/IBX.IBCustomDataSet.TIBCustomDataSet.PrecommittedReads

https://github.com/fschetterer/DDevExtensions/tree/RemoveDMPixelsPerInch

Is there any configurable tool that makes it easier to maintain such compatibility problems?

malom
  • 223
  • 2
  • 11
  • You could create the problematic components during runtime so they are not saved in the dfm. – Delphi Coder Jan 05 '22 at 08:30
  • Yes, it may be a good solution, but requires to rethink the whole project. Creating some components from code would be confusing. I'd rather create the whole datamodule from code. But than I have to fight against multiline SQL statements in code. At the other hand, I would get all the other properties in code, and it may be easier to maintain. Especially field names and string field lengths. – malom Jan 05 '22 at 09:46
  • This might help you getting started (not available for D11 yet): https://gexperts.org/tour/index.html?components_to_code.html – Delphi Coder Jan 05 '22 at 10:55
  • Finally I added a hacky unit to DDevExtensions, based on RemovePixelsPerInchProperty.pas by 2021 Fred Schetterer. It redirects TWriter.WriteProperties() to a method that's body is similar to the original, but filters out properties with name "PrecommittedReads" if it's owner is inherited from TIBCustomDataSet. – malom Jan 05 '22 at 16:20

0 Answers0