----- Original Message -----
From: "mitch_landor" <mlq97@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, February 28, 2006 9:23 PM
Subject: [IBO] Increment Key from Delphi Grid
> I have set up a Firebird table with a Before Insert trigger to
> increment the "ID" key column which is integer type. This works OK in
> the DB.
>
> I can read and edit the table from a Delphi grid, but when I try to
> add a row I get an error message "Field ID must have a value".
>
> How can I get this to insert correctly from Delphi?
Remove the field from the insert sql so that it isn't sent to the server.
The better way is to set up the generator field property of the TIB_Query to
set this value for you. The trigger should test the field for null and only
assign a generated value if it is null.