Subject Re: [IBO] Auto-Incrementing Key Field
Author Frank Ingermann
Hi Jack,

Jack Cane wrote:
> I have configured the key field as an auto-incementing integer. I have it
> hooked to a tdbEdit whose read-only property is set to true. When I press
> the 'Post' button of my tdbNavigator an exception is raised with message,
> "(Field name) is a required field".
>
> I can write some code to update the tdbEdit, but that defeats the purpose of
> the auto-incrementing feature. Is there a property to be set, which
> automates this process?
>
> tks,
>
> jwc

- did you set the GeneratorLinks property accordingly?
( entries in the form "mytable.myidcolumn=mygeneratorname" )

- if you have a "Before Insert" trigger on that table, does it have
"if ((myidfield is null) or (myidfield=0)) then
myidfield = gen_id(myidgenerator,1);"
in it?

(take a look at http://www.fingerbird.de/generatorguide.htm for more detailed
info on the subject of autoinc fields in Fb/IB, esp. with IBO.)

hth,
fingerman
--
-------------------------------------------------------------------------
when parsers parse, and compilers compile, then why don't objects object?

fingerbirdy - fingerman's door to Firebird
http://www.fingerbird.de