Subject | Re: Receiving an Object In Use error when adding an index to a table |
---|---|
Author | Luis Semedo Duarte |
Post date | 2009-05-06T22:22:53Z |
Transactions are created implicitly for every command you send to the database.
After posting the record on Table1 try to commit the transaction. Because you never commited the transaction, the server will not allow you to do shanges on the underlying table until any transactions are commited or rolledback.
Table1.IB_Transaction.Commit;
After posting the record on Table1 try to commit the transaction. Because you never commited the transaction, the server will not allow you to do shanges on the underlying table until any transactions are commited or rolledback.
> db:=TIBODatabase.Create(nil);try this
> db.DatabaseName:='C:\dbs\ne\MIS2000.fdb';
> db.Username:='myuser';
> db.Password:='mypassword';
> try
> table1:=TIBOTable.Create(nil);
> table1.IB_Connection:=db;
> table1.TableName:='COESTUD_D';
> table1.Open;
> Table1.Insert;
> Table1.Fields[0].AsInteger:=1;
> Table1.Fields[1].AsInteger:=2;
> Table1.Post;
Table1.IB_Transaction.Commit;
> Table1.Close;cheers
> finally table1.Free end;
>