D4 + BDE 5.01 + MSACCESS = HELP

Ok here is the scenario:

I have a DLL written in Delphi 4.  The DLL has a data module containing
TTable components connected to MS Access 97 tables via the MSACCESS native
driver.  These tables reference aliases setup using BDE 5.01 with the
MSACCESS drive.  No problems so far.

I have written a test application in Delphi 4 which makes calls into the DLL
to write/retrieve data to/from these tables.  Again no problems.  My test
app loads the DLL and I am able to write to and read from the tables.

However, my problem occurs when I exit my test application.  The shit hits
the fan.  I get an error "Your application has performed an illegal
operation..." and my machine locks completely and I must cold boot to
recover.

This test app is extremely simple.  Just to DLL calls to read and write.

I would appreciate any suggestions.
--
Regards,

David Minor, P.Eng.
Superior Technologies
dmi...@superiortech.com