Accessing?database?in?OCX?givces runtime error 216?on?exit

I am writing a Delphi 4 application that accesses a MS Access 97 database.

This application uses DAO and the BDE Access Native driver to access the
MS Access database. Also we have written some OCX's that are loaded into
the application. These OCX's also use the MS Access database.

Now the problem.
On some computers, the application gives a runtime error 216 when
it is stopped and the OCX's are unloaded. After I have stripped all
database access out of the OCX, the problem is not there anymore.
But as soon as I create a TSession component or a TDatamodule with
a TDatabase component, the problem is there again.

Greetings,

Erik Hermans.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own