For Delphi ClientDataSets, where fields were defined at design time, is there a way at runtime to change a particular field data type (change cds.Fields [n] .DataType)?
I have an outdated Delphi 7 program with the SQLDataSet and ClientDataSet fields set at design time (to override various properties).
They are connected to a third-party Sybase SQL Anywhere 11 database.
Recently, the seller changed all the Description fields from VarChar (128) to a long varchar, but only for some of his customers. Therefore, my code should support both types of fields when I request these Description fields.
I was hoping to set up conditional compilation in the field types of the class (then add the fields before opening the SQL / CLient dataset), but the compiler ignores the conditional expressions {$ IFDEF} in the class component definition section (which, I think more, makes sense)!
There are dozens of modules in which hundreds of fields are affected, so understanding is evaluated.
Thank.
Cheers, EdB
source
share