I have a client data set populated using a stored procedure. Then the client data set is modified by user, but not written back. All worked OK under BDE but, after I switched to CoreLab, I started to get the read-only field error.
Although I set the individual field as .readonly := false, I still get the "Trying to modify read-only field." error.
The field is a calcuated field. If I modify the stored procedure, first calculate the field and write into a temporary table, then return with a join all works fine. Something like this:
create procedure spTest
as begin
// age read only here.
select ID, Name, Age+1 as Age from testtable
end
go
create procedure spTest
as begin
// age can be modified here.
declare @a table (id int, age int null)
insert into @a(id, age)
select ID, Age+1 as Age from testtable
select T.ID, T.Name, A.Age as Age
from testtable T
JOIN @a A ON A.ID = T.ID
end
But as you can see, this is a lot of work, and sometimes not even feasible.
Any suggestions?
Trying to modify read-only field.
Thanks. Just fixing the fields did the trick.
I did not need the sqls or update object or cached updates = true.
Previously, I was trying to fix the readonly := false on clientdataset, in vain.
Now I fix them in the originating query, (afteropen event), and cds recieves them as readonly = false.
It works.
I did not need the sqls or update object or cached updates = true.
Previously, I was trying to fix the readonly := false on clientdataset, in vain.
Now I fix them in the originating query, (afteropen event), and cds recieves them as readonly = false.
It works.