TIBCTAble read-only error

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Tsagoth
Posts: 33
Joined: Wed 15 Jul 2009 01:25

TIBCTAble read-only error

Post by Tsagoth » Fri 23 Oct 2020 04:04

When I issue the statement IBCTable1.Append I get an exception "cannot modify a read-only dataset". Not seeing why the table is being treated as read-only

[code] IBCConnection1 := TIBCConnection.Create(nil);
IBCTransaction1 := TIBCTransaction.Create(nil);
IBCQuery1 := TIBCQuery.Create(nil);
IBCTable1 := TIBCTable.Create(nil);

IBCConnection1.Server := gIBServer;
IBCConnection1.DefaultTransaction := IBCTransaction1;
IBCConnection1.Username := 'SYSDBA';
IBCConnection1.Password := 'masterkey';
IBCConnection1.Database := 'C:\IBDATA\MAILER.IB';
IBCConnection1.AutoCommit := True;

IBCTransaction1.DefaultConnection := IBCConnection1;
IBCTransaction1.IsolationLevel := iblCustom;
IBCTransaction1.Params.Add('read');
IBCTransaction1.Params.Add('write');
IBCTransaction1.Params.Add('wait');
IBCTransaction1.Params.Add('concurrency');

IBCQuery1.Connection := IBCConnection1;
IBCQuery1.AutoCommit := True;
IBCQuery1.UniDirectional := True;
IBCQuery1.Transaction := IBCTransaction1;

IBCTable1.Connection := IBCConnection1;
IBCTable1.KeyGenerator := 'IDXGEN';
IBCTable1.ReadOnly := False;
IBCTable1.Transaction := IBCTransaction1;
IBCTable1.UniDirectional := True;
IBCTable1.TableName := 'MAIL';
IBCTable1.UpdateTransaction := IBCTransaction1;
IBCTable1.AutoCommit := True;

IBCConnection1.Connected := True;
IBCTable1.Active := True;
[/code]

Tsagoth
Posts: 33
Joined: Wed 15 Jul 2009 01:25

Re: TIBCTAble read-only error

Post by Tsagoth » Sat 24 Oct 2020 03:19

Problem solved. Through trial and error, determined it was the Unidirectional = True, and then reading the help file, it does say that setting Unidirectional = True makes the dataset read-only.

oleg0k
Devart Team
Posts: 190
Joined: Wed 11 Mar 2020 08:28

Re: TIBCTAble read-only error

Post by oleg0k » Thu 29 Oct 2020 15:30

Hello,
Thank you for the interest to our product.
It is good to see that the problem has been solved.

wbr, Oleg
Devart Team

Post Reply