Subject Re: Default value for Required property in TIBOQuery
Author
Just did a 20 minute writeup and my answer dissapeared!!
Might be problems with Yahoo... ?!?


---In IBObjects@yahoogroups.com, <gcobb.ibobjects@...> wrote :

When I put a TIBOQuery on a form and create a field for it in the designer, the default value of the Required property for that field is False.  Often though in our codebase, we are creating instances of queries at run-time instead of design-time, so the fields are getting generated for us automatically at run-time based on the SQL we provide them.  When this happens, the default value of the Required property appears to instead be True.  We work with an in-memory dataset class from a 3rd party and one of our common patterns is to open a TIBOQuery and then copy the dataset in to the in-memory dataset which is what the controls in the GUI are connected to.  We have a helper method we often use to automatically create fields in the in-memory dataset to match the fields in the query dataset and then copy the data.  When we switched to using IBO recently one of the problems that came up was everywhere that had code copying a TIBOQuery into this in-memory dataset was broken because now all fields got set to Required = True when they should not have been which then sets off validation errors when a field is left blank even though blank should be allowed.  We created a modification to our helper method to allow us to specify to set all the copied fields to Require = False, but ideally we would like for the TIBOQuery to act the same at run-time as it does in design-time and as other TDataset based components act since it seems this should be taken care of in the IBO library instead of in the application logic.  The TIB_Query and similar components may have the same issue when generating the fields at run-time though I have not tested this to be sure. 


Note:  This is my 3rd time posting this because I kept having my main email address show up and I don't want that spammed by bots so I have now created an email just for this mailing list.  Sorry if anyone is getting spammed by this post.  I won't delete and repost again since I now have an email associated that I don't mind getting spammed.