"Required" changes in Descendent Component

indigo

Member²
I have a TOracleDataSet descendant component I use in my applications. The field definitions have been loaded as persistent fields. I go in and set all the fields Required property to false. Later, I find that fields which are listed as non-null in the database have been set back to required. How do I prevent DOA from modifying the Required property in the persistent fields of the descendant component?
 
When "Add All Fields" is used to pull in the persistent field definitions, the fields that do not allow null have "required" set "True" and the ones that allow null have "required" set False. I then select all the fields and set "required" to false. When I run the program, I get messages like "TransactionNo must have a value.". When I check I find that the persistent field "Required" value has reverted to "True". I am not sure when this is happening.

There was another post from someone in this forum who described the same or similar problem but I don't understand how they fixed it:

"I found a combination where it would work. The reason is that the internal TDataSetProvider uses the field list of the internal TOracleDataSet to identify mandatory columns. I had to set those columns to not required too and not only the fields of my TClientDataSet descendent."
 
Are you using a TDataSetProvider as well? I can't imagine why the Required properties of these persistent fields would change. As a test you could set TOracleDataSet.OracleDictionary.RequiredFields to False. Now the internal TOracleDataSet processing will not even attempt to determine the required fields.
 
I am not using a TDataSetProvider. I decided just to override the DoAfterOpen in my component and set Required := False for all fields.
 
Back
Top