On Tuesday 01 September 2015 10:30:44 mohamed hamza wrote:
> Hi Martin,
>     It's  a good practice  to let the user to choose between options 
> (dno_multiselect is right ).
> My error concerns  how to insert record because I have IBConnect error 
> occured.also datasource1  , but I have a  tdbwidgetGrid 
> .datasource:=datasource2 
> and I want to Insert  record only to datasource1.dataset (  the datasource of 
>  tdbnavigator).

Are there also two datasets? If the dataset is common to datasource1 and 
datasource2 it is not possible to insert only into datasource1 because the 
actual data is stored in the dataset not in the datasource. tdatasource is 
solely a connector to the dataset.

> That explains the error ibconnect execute validation error for column cKey 
> value ** null ** the dataset name is datasource2.dataset.name
> I tried og_noinsertempty but nothing flpo_syncmasterinsert is true I need it 
> when TDbNav.datasource will become datasource2   Thanks to reply.

How do you generate the cKey value? For firebird primary keys I normally use a 
trigger procedure in the database, example:
"
SET TERM ^ ;
CREATE TRIGGER PK1 FOR TABLE1 ACTIVE
BEFORE INSERT POSITION 0
AS 
BEGIN 
if (new.cKey is null) then begin
  new.cKey = gen_id(gen_table1_id,1);
 end
END^
SET TERM ; ^
"
and activate "of_inkey" and "of_refreshinsert" of "optionsfield" of the cKey 
field in your example in order to automatically update the local cKey field by 
the value generated by the database.

Martin

------------------------------------------------------------------------------
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to