1
votes

I use the next chain

TADOQuerry->TDataSetProvider->TClientDataSet

to got data for Items and ItemType table and work with it offline. Item TADOQuery's SQL property contains a simple query

select i.ID,i.Name, i.TypeID, i.Qnty, i.Price, it.TypeName 
from Items i join ItemType it on (it.ID = i.TypeID)

ItemType's even simpler:

select * from ItemType

now - for cdsItems I modify TypeName field to be an look-up field and chain it to cdsItemType - nothing uncommon - and bound cdsItems to a grid. But when I try to modify data through using combobox in grid - it throws an error "Trying to modify read-only field".

I set to all fields of both TCliendDataSet ReanOnly:= false. Also, after I got data into TClientDataSets - using an for - I set again to all fields ReadOnly:=False. But even that I still got "Trying to modify read-only field".

Used database is MS SQL Server 2005 Express edition.

1
Have you tried setting read-only to false on the fields of the ADOQuery? - Sertac Akyuz
already - in both design and run time - DreadAngel
When you changed the TypeName field in cdsItems into a lookup field, did you also change the query not to include the TypeName field anymore? - Uwe Raabe
no, should I exclude it? - DreadAngel
Yes, otherwise you get two interfering field descriptions. - Uwe Raabe

1 Answers

2
votes

FOUND!!!!

The bug where located in the type of TypeID column of GetItems query (ADOQuery type) - when I loaded all the field into it - the TypeID where added as TAutoIncField - when I changed it to TIntegerField - everything goes well.