Subject Re: [IBO] A few questions
Author Geoff Worboys
> 1- In my first shot at making an IB_component, I encountered
> a rather strange phenomenon where setting the datafield at
> design time (after having set the datasource property and a
> query dataset) through the object inspector gives an
> 'Invalid class typecast' error.

This is a standard problem with DataField properties. You can usually
type the field name directly into the property, but the selection list
presents this error.

You need to register a property editor for this control. If you look
at IB_Editors.pas you will see where Jason has setup a function to
make this easier, eg;

RegisterDataFieldPropertyEditor( TIB_CustomCheckBox );


> 2- Is it possible to retrieve a database's column default
> values at design time from the server, so that any new
> query referencing those columns will automatically acquire
> these defaults?

It is possible (see GetServerDefaults property) but generally not
recommended due to performance impacts.


> 3- Is it possible to enter column settings (defaults, blank
> is null, boolean, etc...) in a central location, and have
> any queries automatically inherit these settings?

Take a look at TIB_Connection, it has all the Fields*,
ColumnAttributes etc properties. It also provides a FieldEntryTypes
property where you can optionally enable the fetDomainName and/or
fetSQLType attributes to allow the various attributes to be set by
domain name or SQL type.

Note: It works something like...

If the connection has an entry like...
Table_Name.Field_Name= ....
then that will be found as an exact match otherwise
Field_Name=...
will be found as a field name only match otherwise
Domain_Name=...
will be found otherwise
SQL_Type=...


HTH

Geoff Worboys
Telesis Computing