Главная страница | назад





Article #17617: Access violation on shutdown of Database app

 Question and Answer Database
FAQ2617C.txt Access violation on shutdown of Database app
Category :VCL
Platform :All
Product :C++Builder 3.x
Question:
When my Database app shuts down I get an Access violotaion.
When I debug into the VCL, i noticed that it happens in the
DBTables.pas file on line 2626 (or around there) in the
TSession.RemoveDatabase function.
Why is this?
Answer:
In the datamodule or the form (which ever contains the
TSession, and TDatabase components), make sure that the
creation order has the TSession prior to the TDatabase.
If the TDatabase is destroyed prior to the TSession, the
TSession will try to remove it from the list of connected
TDatabases'. This will cause an access violation due to
the fact that the TDatabase has already been destroyed.
7/2/98 10:32:32 AM

Last Modified: 01-SEP-99