Page 1 of 1

TIBCTAble read-only error

Posted: Fri 23 Oct 2020 04:04
by Tsagoth
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]

Re: TIBCTAble read-only error

Posted: Sat 24 Oct 2020 03:19
by Tsagoth
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.

Re: TIBCTAble read-only error

Posted: Thu 29 Oct 2020 15:30
by oleg0k
Hello,
Thank you for the interest to our product.
It is good to see that the problem has been solved.

wbr, Oleg
Devart Team