Cannot modify Read-Only DataSet

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
DCast
Posts: 4
Joined: Wed 30 Nov 2005 17:47

Cannot modify Read-Only DataSet

Post by DCast » Thu 22 Feb 2007 16:01

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

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Thu 22 Feb 2007 18:07

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 23 Feb 2007 10:07

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.

DCast
Posts: 4
Joined: Wed 30 Nov 2005 17:47

Post by DCast » Tue 27 Feb 2007 10:15

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

Post Reply