Cannot close a program

I have a very simple program that opens 10 tables (I'using TIBQuery
components), closes it and terminates.
The program opens and closes the tables very fast but hangs up during the
shut down phase. I have found that after the opening of the tables the
number of the attachments to the database increases and remains high for a
(relative) long time. If I try to close the program the the program hangs up
until the attachments are presents.
If I close the connection (TIBDatabase.Connected := False) before shutting
down the program, then the program terminates normally but the attachments
to the database are still presents and until this are presents i cannot
re-run the program.
I have this problem only with a specific database, i have tried to do a
backup/restore but the problem persists.
Anybody can help me ??

TIA

sergio sette