Subject | Re: A few questions |
---|---|
Author | lobolo2000 |
Post date | 2001-08-06T04:45:13Z |
Thanx Geoff.
1- I knew I was missing something obvious. I will try registering the editor
for this component. However note that even typing a character in the object
inspector generates this error.
My impression was that this editor was registered for all components as is
the case with TFieldDataLink (I guess). It saves the component writer the
trouble of having to register the editor for each data aware component that
uses the TIB_FieldDataLink.
2- There seems to be a misunderstanding here. I do not need to retrieve
defaults, NOT NULL, etc... at runtime, something which is possible, but
might be expensive as you said. But rather at design time where I make sure
that an IB_Query gets the latest defaults (for example by right clicking on
it and choosing 'Retrieve Server Defaults') so that any INSERT would use
these defaults until they are explicitly changed by another design-time
manual 'Retrieve server defaults'.
3- I have tried setting a default value for a column in the IB_Connection,
but it does not seem to propagate to the query (at least in design time).
But I did not understand the fetDomainName and fetSQLType. Could you shed
more light on this issue pls?
1- I knew I was missing something obvious. I will try registering the editor
for this component. However note that even typing a character in the object
inspector generates this error.
My impression was that this editor was registered for all components as is
the case with TFieldDataLink (I guess). It saves the component writer the
trouble of having to register the editor for each data aware component that
uses the TIB_FieldDataLink.
2- There seems to be a misunderstanding here. I do not need to retrieve
defaults, NOT NULL, etc... at runtime, something which is possible, but
might be expensive as you said. But rather at design time where I make sure
that an IB_Query gets the latest defaults (for example by right clicking on
it and choosing 'Retrieve Server Defaults') so that any INSERT would use
these defaults until they are explicitly changed by another design-time
manual 'Retrieve server defaults'.
3- I have tried setting a default value for a column in the IB_Connection,
but it does not seem to propagate to the query (at least in design time).
But I did not understand the fetDomainName and fetSQLType. Could you shed
more light on this issue pls?
----- Original Message -----
From: "Geoff Worboys" <geoff@t...>
Date: Mon Aug 6, 2001 3:57 am
Subject: Re: [IBO] A few questions
> 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
_________________________________________________________
Do You Yahoo!?
Get your free @... address at http://mail.yahoo.com