access violation when opening query

I have a query in an app that has its own session and database, I repeatedly
close it, clear the SQL, set the SQL again then open it, At a certain point,
usually the 5th itteration I get an access violation when opening it.  I
have checked the SQL, and have no other queries or tables open on the table
at the same time.  The session and database the query uses are not used by
any other queries or tables.  The query exists when I open it  as I create
it in the forms constructor, and free it in the destructor, and the access
violation dosn't occurr when i set the SQL.  I dont use any network
settings, the database works on a stand alone PC.
I am aware of the BDE memory leak problem when repeatedly running the same
query.  Where you have free and recreate the session, database and any
queries belonging to the session on around the 300th iteration.