Subject Re: [IBO] Field value required - MIDAS
Author Helen Borrie
At 08:04 AM 05-07-01 +0100, you wrote:
>Hi All,
>I have, I am sure a simple problem :
>Client server application using IBOBJECTS and MIDAS/MTS.
>Table TEST :
>field TEST_PK integer not null
>field TEST_DATA integer
>trigger before_insert
>generator GEN_TEST_PK

If setting the Required property in the Delphi Object Inspector (when the persistent field object is selected in the Delphi Fields Editor) doesn't work, then access the IBO InternalDataset.ColumnAttributes in the BeforePost event and set it there, viz.

MyDataset.InternalDataset.ColumnAttributes.LinkValues['TEST_PK'] := IB_NOTREQUIRED;

>I then create a test client app with just one dbgrid.
>I cannot create a row if I don't put the value of the primary key myself. (I get "Field value required)
>I set up the generator on the IBOQuery on the DELPHI server side.
>I tried to change the properties "required", "autogeneratedvalue", "required" on the CLient Dataset but it still doesn't work.

Don't set AutogenerateValue to arAutoinc because a generator is not an Autoinc type. Leave it arNone.

>I believe the problem is on the client side as I don't think my insert ever goes to the server.

What is the code for your Before Insert trigger?

Regards,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________