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
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