TIBCQuery Execute/ExecSQL uses read-only transaction

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
KeitaroBR
Posts: 3
Joined: Wed 21 Mar 2007 16:53
Location: Florianópolis - SC
Contact:

TIBCQuery Execute/ExecSQL uses read-only transaction

Post by KeitaroBR » Thu 02 Dec 2010 11:58

Hi,

how could I make TIBCQuery use the UpdateTransaction when the SQL called with execute is an UPDATE/INSERT?

Example:

Code: Select all

qy.Transaction := readOnlyTrans;
qy.UpdateTransaction := updTrans;
qy.SQL := 'UPDATE Client SET code=code+1';
qy.Execute;
In this case it uses readOnlyTrans, thus resulting in an error "attempting to update during read-only transaction"

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 03 Dec 2010 12:58

The UpdateTransaction property is used to get a transaction for modifying a dataset that was opened using the SELECT statement in the SQL property. In your case you should use the Transaction property instead of UpdateTransaction.

Post Reply