Subject RE: Attn Helen Borrie: Re: [IBO] Calculated fields
Author Claudio Valderrama C.
> -----Original Message-----
> From: stewartbourke@... [mailto:stewartbourke@...]
> Sent: Martes 13 de Marzo de 2001 20:47
> >
> > I did the following:
> >
> > 1. Placed a tibotable on the form and assigned it to a table
> > 2. Double clicked the table to bring up the fields editor
> > 3. In the FE, I added all fields, then a new field , type
> calculated
> > and called it tbLeadHdrLdh_name_details, type string, 30 chars
> > and in my oncalc event:
> >
> > tbLeadHdrLdh_Name_Details.AsString:='Details: '+
> >
> > tbLeadHdrLdh_FirstName.AsString+', '+tbLeadHdrLdh_SurName.AsString
> >
> > This causes the exception 'dataase not in edit mode'

I put a TIBOQuery linked to a TIB_Connection. ReadOnly is true and
RequestLive is false for the TIBOQuery. The statement is
select rdb$relation_name
from rdb$relations

Created a column named "n" of type integer and in the OnCalcFields event I
put

IBOQuery1n.Value := Length(IBOQuery1RDBRELATION_NAME.Value)

So far so good, no problems. Put a TIBOTable, linked to the same
TIB_Connection. Since a system table doesn't appear in the TableName
dropdown in TIBOTable, I simply selected another table mine, called M1,
whose only field is called A. The table's ReadOnly property is false and I
created again a field named "n". In the onCalcFields event, I did

IBOTable1n.Value := Length(IBOTable1A.AsString)

After setting the TIBOTable's ReadOnly property to True, I still can get the
calculated field. No problem.

I put a TIBODatabase and connected it to the same db than the previous
TIB_Connection. Even more, put the TIBODatabase's ReadOnly property True.
Attached the previous TIBOTable (with its ReadOnly=True, too) to that
TIBODatabase. I still can see the calculated field when opening the table.

So, really, Stewart, I don't have any idea what's your problem. I couldn't
reproduce it even though I fiddled with several settings. Only idea is:
check that you have enough privileges on the underlying table. Try setting
TIBOTable.ReadOnly to True.

C.