Delphi 6 TQuery cannot modify a read-only dataset in one windows XP machine

1.8k Views Asked by At

I have an issue with an old Delphi 6 app, that i had to edit lately. The case is that i had to use a TQuery to edit some data, so i created a TQuery, TDataSource and TDBEdit, i Linked the DataSource to the query, created all the fields in the query and then linked the DBedit to the DataSource.

the database that is used is DBase IV with BDE.

On change of the field i do the next code :

if not (DM.qryPrecios1.State in [dsEdit, dsInsert]) then begin
  DM.qryPrecios1.Edit;
end;

and in a button afterwords i do

if DM.qryPrecios1.State in [dsEdit, dsInsert] then
  DM.qryPrecios1.Post;

The curiosity of the case is that in my windows XP this works correctly without any issue, it updates the correct field etc..

but when i went to update the client machine that is windows XP as well, i get the next error when i try to change the TDBEdit = 'qryPrecios1 cannot modify a read only dataset'

Im confused as if its a case of the app or of some dll missing in the client machine?

Thank you for the help in regards.

2

There are 2 best solutions below

0
On

Well it seems that it was a Delphi 6 IDE Bug.... after i created a new TQuery copying the old one, the TQuery that didnt work started to work without changing anything.

0
On

Try specifying rowid in the query then OracleDataSet1.Edit should not return an error (helps when using DOA component)

OracleDataSet1.SQL.Text:='select d.rowid, d.* from discounts d';
OracleDataSet1.Active:=true; 
OracleDataSet1.Edit;