Subject Re: Receiving an Object In Use error when adding an index to a table
Author Luis Semedo Duarte
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.

> db:=TIBODatabase.Create(nil);
> 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;

try this
Table1.IB_Transaction.Commit;

> Table1.Close;
> finally table1.Free end;
>

cheers