TField.Attributeset explanation?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

TField.Attributeset explanation?

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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TField.Attributeset explanation?

michael.vancanneyt


On Mon, 5 Sep 2011, Reinier Olislagers wrote:

> 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TField.Attributeset explanation?

Reinier Olislagers
On 5-9-2011 10:30, [hidden email] 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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TField.Attributeset explanation?

Alexander Shishkin
In reply to this post by michael.vancanneyt
05.09.2011 12:30, [hidden email] пишет:

>
>
> 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 - [hidden email]
> 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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TField.Attributeset explanation?

michael.vancanneyt


On Mon, 5 Sep 2011, Alex Shishkin wrote:

> 05.09.2011 12:30, [hidden email] пишет:
>>
>>
>> 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 - [hidden email]
>> 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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TField.Attributeset explanation?

Reinier Olislagers
On 5-9-2011 11:39, [hidden email] wrote:

> On Mon, 5 Sep 2011, Alex Shishkin wrote:
>> 05.09.2011 12:30, [hidden email] пишет:
>> 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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TField.Attributeset explanation?

michael.vancanneyt


On Mon, 5 Sep 2011, Reinier Olislagers wrote:

> On 5-9-2011 11:39, [hidden email] wrote:
>> On Mon, 5 Sep 2011, Alex Shishkin wrote:
>>> 05.09.2011 12:30, [hidden email] пишет:
>>> 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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal