I have created an .OCX project that consists of four individual usercontrol components. This/these components are for the use of my fellow developers. Some of the developers may use just two of the components, others might use them all. All the components are connecting to a database (access) using ADODB.connection. My problem is if a developer uses all of my components on a single form of a single project, the application takes too long to load (the connection is made four times). I have a public procedure within each component and I use the following code line(s) so that the connection is only made at run-time.
VB Code:
If usercontrol.ambient.usermode = true then cn.Open "Provider = ....... etc etc....) End If
Question:
Is it possible for a connection to be made just once for however many components are used? I can forecast a problem where my OCX project will contain as many as fifteen ocx components (each of which will make a connection) and a developer will use for example six or seven of these components.
Six connections = slow load of the application.
Note
I am querying a single ADODB.connection and not a single ADODB.recordset – each of the components are connecting to different tables.
Hope ive explained it well enough
thanks





Reply With Quote