|
If you use any data objects in
your code (DAO, RDO, or ADO), you should be sure to explicitly close all
open recordsets, databases, and workspaces before you exit. Even though
the pointers to these objects are automatically destroyed when you exit
the program, if you fail to explicitly close all open items, your database
connections may not be immediately released and the memory used by these
objects may never be re-allocated by the operating system. Here's a short
routine you can add to your Form_Unload event (or some other terminating
code module) that will close all open DAO workspaces, databases, and
recordsets and release the memory reserved by these objects. This code
will work whether you have 1,
100, or even no connections open when you attempt to exit the form.
'-------------------------------------------------- Published January, 1999
|