When you refer to modules are you referring to Dll's or simply class modules within your project?
If you are speaking fo class modules within your project there are several ways to accomplish this and the same could be true if the dll's are referenced within the same project/application.
Are you using a global connection object? In most of my application I use a global connection object and local recordset objects, if the application is data intensive. What I want to avoid, as well as having multiple connections for the same application, is the overhead of repeated connections to the database. So, I have a similar set of tools as you do - I use dll's. I will create a global database connection object at the project level and then connect to the application on startup for data intensive applications and then disconnect when the application shuts-down. For other application where that involve intermittent access to data I will use a connection function that check the state of the global database connection object. Usually, I will check to see if it is set to nothing if it is then I will call a function to create the connection and pass it the global connection object. If the connection object is not set to nothing then I simply execute my data logic. You may be better served by checking the State property of the connection object as well.
Hope this helps.
Larry Asher
|