Subject RE: [IBO] Auto-Incrementing Key Field
Author Jack Cane
Frank,

OK, in the GeneratorLinks property of the tDataSource I added
TableName.FieldName = GeneratorName. In the DDL for the table I added "or
(FieldName=0)", which was not present in the DDL script, only
"(FieldName=null)".

Looks like that succeeded.

Vielen Dank!

jwc
-----Original Message-----
From: Frank Ingermann [mailto:frank@...]
Sent: Sunday, October 13, 2002 3:30 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Auto-Incrementing Key Field


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


Yahoo! Groups Sponsor
ADVERTISEMENT






___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.

___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


[Non-text portions of this message have been removed]