Subject Re: [IBO] Re: Problem changing data in TIB_LookupCombo and TIB_Grid components
Author Helen Borrie
At 08:26 AM 17/03/2003 -0500, you wrote:
>Thanks Helen,
>
> > At 04:04 PM 14/03/2003 +0000, you wrote:
> > >I am relatively new to IBO and still learning the ins and outs of it.
>I
> > >have practically memorized the article "Configuring TIB_LookupCombo"
> > >and still cannot resolve the following problem. If anyone can tell me
>
> > >what I am missing, I would be very grateful - not to mention able to
> > >move forward again with my project!
> > >
> > >Situation: I using TIB_Grid in read-only mode
> >
> > If the grid is in read-only mode, it can't be edited from the user
> > interface. The lookup key will poll out correctly to the
> > Lookup dataset but any changes requested via the UI will fail.
>
>I did consider that having the grid in read-only mode was the problem -
>however the problem still persists when the grid is set to ReadOnly :=
>False.
>
>Just to check if you were "hearing" me correctly. . . . I am not
>intending to update the columns in the grid. I have separate lookupcombo
>components on my form - from which I want to update the fields. Does
>your statement apply to this situation?

I don't know - what kind of lookupcombo controls are they?
If ib_lookupcombo, are their datasets set up properly for updating
(KeySource, KeyLinks)?

Are the polling columns updatable? ---- Just looked back at your query, and
the Description column isn't updatable:

Select
(Select ProgramDescription
from HBProgram
where CP.ProgramID = HBProgram.ProgramID) as ProgramDescription
, (select (Select FULLNAME FROM FORMATNAME(
person.firstname,
person.middlename,
person.lastname, 'LNF'))
from CASEMANAGER join Person P on CaseManager.PersonID =
P.PersonID
where CP.CaseManagerID = CaseManager.CaseManagerID) as
CounselorName
, CP.IsPrimary
, CP.DATESTARTED
. . . (many other fields ommitted)
FROM CASEPROGRAM CP
where CP.CaseID = :CaseID

So, the answer is, if you have lookupcombos linked to non-updatable fields,
not lookupcombos nor anything else (e.g. direct assignment) will make them
updatable. Subselected output values are *never* updatable; and, in a
joined set, you can update fields in one table AT MOST (as long as that
table is named as the KeyRelation) and then *only* database columns. The
way to make more than one table updatable is to write a stored procedure to
do it, and pass the keys of the involved tables to it as input parameters.

Sorry for not noticing that first time around.

Go back to the write-up on lookupcombos, and you will see that the linkage
is made from the primary key equivalent of the lookup set, back to a
polling key in the parent set.

regards,
Helen