[fpc-pascal] TField.Attributeset explanation?
Hi all, Working on the SQLDB Tutorial1 on the wiki. I'm struggling with getting dbgrid-driven inserts to work. Using Firebird employee.fdb CUSTOMER table; CUST_NO is an integer primary key with Firebird generator/sequence + trigger = sort of an autonumber/autoinc field. When inserting records with an empty CUST_NO, I get an error that CUST_NO is required. Somebody on a Dutch forum told me to try to predefine SQLQuery field definitions, and set faRequired to false for CUST_NO. While that didn't seem to work for me, I thought why not programmatically set that property after loading the query and found http://freepascal.org/docs-html/fcl/db/tfield.attributeset.html However, it doesn't say exactly what AttributeSet is meant for, and more importantly, what values to set. A grep through the FPC source code didn't help either. So my questions: 1. What does Attributeset mean 2. What strings can I feed it with 3. Would that help in my case (of course, this is the FPC list, so any answer to this Lazarus-related question would be a bonus ;) Sample source code with Windows embedded Firebird dlls, database can be downloaded from https://bitbucket.org/reiniero/fpc_laz_patch_playground/downloads/laztut_nlDelphi_embedded4sept.zip Thanks, Reinier ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TField.Attributeset explanation?
On 5-9-2011 10:30, michael.vancann...@wisa.be wrote: On Mon, 5 Sep 2011, Reinier Olislagers wrote: When inserting records with an empty CUST_NO, I get an error that CUST_NO is required. That is normal. Just set the 'Required' property of the CUSTNO field to False. AAARGGH. A million thanks, Michael. That works. I KNEW it would be simple. Why hadn't I looked at required in the fielddefs...!?!?!? Forget the 'Attributeset' property. It's not used in FPC. (in fact, I don't even know what it's for or where it comes from) Ok, I noticed it isn't used ;) Thanks again, Reinier ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TField.Attributeset explanation?
05.09.2011 12:30, michael.vancann...@wisa.be пишет: On Mon, 5 Sep 2011, Reinier Olislagers wrote: That is normal. Just set the 'Required' property of the CUSTNO field to False. Forget the 'Attributeset' property. It's not used in FPC. (in fact, I don't even know what it's for or where it comes from) Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/DB_TField_AttributeSet.html ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TField.Attributeset explanation?
On Mon, 5 Sep 2011, Alex Shishkin wrote: 05.09.2011 12:30, michael.vancann...@wisa.be пишет: On Mon, 5 Sep 2011, Reinier Olislagers wrote: That is normal. Just set the 'Required' property of the CUSTNO field to False. Forget the 'Attributeset' property. It's not used in FPC. (in fact, I don't even know what it's for or where it comes from) Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/DB_TField_AttributeSet.html In short, Delphi also no longer uses it, as TTable and TQuery are BDE components and they are deprecated. None of the newer technologies uses the data dictionary. I never understood why they abandoned their data dictionary technology :/ Michael.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TField.Attributeset explanation?
On 5-9-2011 11:39, michael.vancann...@wisa.be wrote: On Mon, 5 Sep 2011, Alex Shishkin wrote: 05.09.2011 12:30, michael.vancann...@wisa.be пишет: Forget the 'Attributeset' property. It's not used in FPC. (in fact, I don't even know what it's for or where it comes from) Michael. http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/DB_TField_AttributeSet.html In short, Delphi also no longer uses it, as TTable and TQuery are BDE components and they are deprecated. None of the newer technologies uses the data dictionary. I never understood why they abandoned their data dictionary technology :/ Michael. See documentation patch: http://bugs.freepascal.org/view.php?id=20152 Be gentle - it's my first doc patch ;) Regards, Reinier ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TField.Attributeset explanation?
On Mon, 5 Sep 2011, Reinier Olislagers wrote: On 5-9-2011 11:39, michael.vancann...@wisa.be wrote: On Mon, 5 Sep 2011, Alex Shishkin wrote: 05.09.2011 12:30, michael.vancann...@wisa.be пишет: Forget the 'Attributeset' property. It's not used in FPC. (in fact, I don't even know what it's for or where it comes from) Michael. http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/DB_TField_AttributeSet.html In short, Delphi also no longer uses it, as TTable and TQuery are BDE components and they are deprecated. None of the newer technologies uses the data dictionary. I never understood why they abandoned their data dictionary technology :/ Michael. See documentation patch: http://bugs.freepascal.org/view.php?id=20152 Applied, thank you ! Michael.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal