Page 1 of 1
Cannot modify Read-Only DataSet
Posted: Thu 22 Feb 2007 16:01
by DCast
Hi there,
I have a problem, when trying to .append/.insert to a TOraQuery.
Everytime i try i get this message:
"Cannot modify Read-Only DataSet"
I tried to read the ReadOnly property of the Query and it tells me, it's NOT Read-Only.
Can anyone please help me out on this.
Thx.
/Michael
Posted: Thu 22 Feb 2007 18:07
by MarkF
Hi,
I think that you need to check "CanModify" to see if the dataset is editable. ReadOnly is only used to force ReadOnly mode on an editable dataset.
Good luck!
-Mark
Posted: Fri 23 Feb 2007 10:07
by Plash
The TOraQuery component can insert records if you set the SQLInsert property to a SQL statement that is executed to insert record into a database.
You can use the TSmartQuery component instead of TOraQuery. The TSmartQuery component automatically generates SQL for record insertion. For this component you only need to set the UpdatingTable and KeyFields properties to make dataset editable.
Note: In ODAC 6 the TOraQuery component also can generate update commands automatically.
Posted: Tue 27 Feb 2007 10:15
by DCast
Hi Guys,
Thx for your replies.
I did allready try setting the ReadOnly properties without effect.
The solution is in fact to set the KeyFields + The Update/Insert SQL.
/Michael