Rascal
2008-04-04 12:03:30 UTC
Hi,
I have a strange problem here:
Delphi 2007
1. ClientDataSet grabs its dataset from a stored procedure (SP executes a
SELECT statement to return a cursor).
2. All the persistent fields (added to Fields Editor @ design-time) have
their Required property set to False.
3. Two more fields found in the FieldDefs have faRequired in their
Attributes property - those two are not created @ design-time (and do not
appear in the Fields Ediotor)
Upon "Post" I receive "Field Value Required". Unfortunately, the exception
does not say WHAT field is required.
(http://qc.codegear.com/wc/qcmain.aspx?d=54380)
What I have found out is that I have to
0. Set DisableStringTrim to true for CDS
1. Add to the set of persistent fields ALL the fields from the SP's dataset
2. Loop through FieldDefs
3. Set a dummy value (i.e. ' ' for ftString) for those fields that have
faRequired in Attributes (+ VarIsNull(field.value) = true for those fields).
Then I can post.
Now the problem is that I'm trying to convert a Delphi 3 application to
D2007. I have loads of CDS's and SP's ... and the code in D3 never reported
"Field Value Required"
Questions:
1. Why Delphi says "Field Value Required" when Required for Field is set to
False (manually).
2. Is there a workaround?
3. Is there a way to know exactly what field IS required in the Exception
raised?
-rascal
I have a strange problem here:
Delphi 2007
1. ClientDataSet grabs its dataset from a stored procedure (SP executes a
SELECT statement to return a cursor).
2. All the persistent fields (added to Fields Editor @ design-time) have
their Required property set to False.
3. Two more fields found in the FieldDefs have faRequired in their
Attributes property - those two are not created @ design-time (and do not
appear in the Fields Ediotor)
Upon "Post" I receive "Field Value Required". Unfortunately, the exception
does not say WHAT field is required.
(http://qc.codegear.com/wc/qcmain.aspx?d=54380)
What I have found out is that I have to
0. Set DisableStringTrim to true for CDS
1. Add to the set of persistent fields ALL the fields from the SP's dataset
2. Loop through FieldDefs
3. Set a dummy value (i.e. ' ' for ftString) for those fields that have
faRequired in Attributes (+ VarIsNull(field.value) = true for those fields).
Then I can post.
Now the problem is that I'm trying to convert a Delphi 3 application to
D2007. I have loads of CDS's and SP's ... and the code in D3 never reported
"Field Value Required"
Questions:
1. Why Delphi says "Field Value Required" when Required for Field is set to
False (manually).
2. Is there a workaround?
3. Is there a way to know exactly what field IS required in the Exception
raised?
-rascal