Subject Re: Defaults and Delphi 6.0
Author Adam
--- In, "joseph_ceasar"
<joseph_ceasar@y...> wrote:
> I created a new table and set default values for certain fields.
> When I edit the table using IBOCONSOLE, as soon as I add a new
> record, the fields for which default values are defined, are
> populated with the default values. So far so good.
> Now I go to Delphi and create a small test app. I am using the IB
> componets that came with D6 (at least I think they came with D6). I
> use a IBDatabase, an IBTable and a regular datasource component to
> access the data. I then drop in a DBGrid and link everything
> together. When I insert a new rec in the grid, the default values
> don't show up. I even tried other data aware components and I
> don't get thos default values to show up. What am I doing wrong?

You are using TIBTable, that is what you are doing wrong, argh.

If you want to use the IBX components, then stick with TIBQuery and
TIBSQL depending on what you are doing. TIBTable can be horrendously
slow on large datasets.

You can use a ClientDataset or equivalent to plug into a simple
DBGrid or equivalent data aware control, and use a query to fill it

Default values are only applied during an insert operation, and only
if you do not specify a value for that field. My guess is that the
TIBTable is specifying each of the fields and plopping a NULL in
there for you.

> Thank you