TIBCTAble read-only error
Posted: 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]
[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]