Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calculated Field - Not in edit or Insert mode error

444 views
Skip to first unread message

Rick Ross

unread,
Feb 21, 1998, 3:00:00 AM2/21/98
to

I have a master table with some detail records. Both the master and
detail have calculated fields. I consistently get a "Database not in
insert or edit mode" error when the master tables oncalcfield event
fires. Can I have calculated fields in a table with details or is
something else wrong?


WmBurke(TeamB)

unread,
Feb 22, 1998, 3:00:00 AM2/22/98
to

>>Can I have calculated fields in a table with details

Yes

>> or is something else wrong?

Do all of the fields to which you're assigning values have:

Delphi 1/2 : the Calculated property set to true
Delphi 3 : a fieldKind of fkCalculated
?

===
Bill

clays...@hotmail.com

unread,
Feb 23, 1998, 3:00:00 AM2/23/98
to

In article <34EE63FF...@ee.net>,

rr...@ee.net wrote:
>
> I have a master table with some detail records. Both the master and
> detail have calculated fields. I consistently get a "Database not in
> insert or edit mode" error when the master tables oncalcfield event
> fires. Can I have calculated fields in a table with details or is
> something else wrong?
>
> Here is some info for DataSET not in edit or insert mode which may help:

Dataset not in edit or insert mode

Possible Cause of Error
You are either attempting to edit a value in a table, or attempting to insert
a new record while the dataset is in a mode other than edit or insert.

Quick Fix
Place the dataset in edit or insert mode before making modifications or
additions to it. For example, if you want to edit current record of the Pizza
table’s MonthlySpecial field, you could do the following:
with Pizza do begin
Edit;
PizzaMonthlySpecial.AsString := 'Italian Garlic';
Post;
end;

Additional Information
For the above syntax to work (PizzaMonthlySpecial.AsString), the field needs
to be instantiated at design time using the Fields editor. Otherwise, you will
need to assign a value to the field using TDataset’s Fields, FieldValues, or
FieldByName properties.
The states, or modes, that a dataset can be in are:
dsBrowse, dsCalcFields, dsCurValue, dsEdit, dsFilter, dsInactive, dsInsert,
dsNewValue, dsOldValue, and dsSetKey

Clay Shannon,
author of the upcoming book "Troubleshooting Delphi - Quick Fixes"


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading

0 new messages