Subject RE: [IBO] state
Author Norman Dunbar
That will be because the database defined ID as NOT NULL so C++
BUilder/Delphi determines that that column must have a value provided by the
application or a posting error will result.
To avoid this and let the trigger do it's stuff, set the Query'sd
CheckRequired property to false. This willhave the effect of not checking
that ANY field has had a value and may be what you want. However, if you
create a new record then try to make changes C++ Builder/Delphi won't know
what the ID value should be (since your trigger entered it) so you'll get
'failed to locate record' type errors.

Set CheckRequired to true and set the GeneratorLinks property to ID=ID_GEN
with no spaces around the '=' sign. If you have more than one generator
derived column then add another line to the GeneratorLinks until you have
defined them all.

Now when you put the dataset into insert mode, IBO will fetch the ID_GEN
value into the ID column and C++ BUilder/Delphi will be aware of this value
- so immediate error corrcetion to your data can be done if you notice a
problem just after you have posted the new record.


Cheers,
Norman.

-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------


-----Original Message-----
From: Gediminas [mailto:gugini@...]
Sent: Tuesday, August 12, 2003 5:29 PM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] state


is dataset must be in edit state in order to let enter text in TIB_Edit?
also got error, that there is missing field then posting: ID is missing,
but there is a before insert trigger NEW."ID" = gen_id( "ID_GEN" , 1 )
what is missing here? i thought, that trigger will insert needed ID value
when posting :-/

At 2003.08.12 15:53, you wrote:
>Try :
> IB_Query->Insert or
> IB_Query->Edit

This email is intended only for the use of the addressees named above and may be confidential or legally privileged. If you are not an addressee you must not read it and must not use any information contained in it, nor copy it, nor inform any person other than Lynx Financial Systems or the addressees of its existence or contents. If you have received this email and are not a named addressee, please delete it and notify the Lynx Financial Systems IT Department on 0113 2892990.