Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-09

TField.Attributeset explanation?

7 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

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

Reply by email

Unknown author
to Reinier Olislagers
Reinier Olislagers wrote 11 lines
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.

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.

Reply by email

Reinier Olislagers
to Unknown author
Show quoted text 7 lines
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

Reply by email

Alex Shishkin
to Unknown author: That is normal. Just set the 'Required' property of the CUSTNO field to False. Forget the…

05.09.2011 12:30, пишет:

Show quoted text 18 lines
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 - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/DB_TField_AttributeSet.html

Reply by email

Unknown author
to Alex Shishkin
Alex Shishkin wrote 20 lines
05.09.2011 12:30, пишет: > > > 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 - > 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.

Reply by email

Reinier Olislagers
to Unknown author
Show quoted text 17 lines
On Mon, 5 Sep 2011, Alex Shishkin wrote: > 05.09.2011 12:30, пишет: > 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

Reply by email

Unknown author
to Reinier Olislagers
Reinier Olislagers wrote 20 lines
On 5-9-2011 11:39, wrote: > On Mon, 5 Sep 2011, Alex Shishkin wrote: >> 05.09.2011 12:30, пишет: >> 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.

Reply by email