We have a setup like this. This way a connection is opened in the procedure itself and you're not relying on the fact that there is an open connection for a start, secondly, the active connection object is only held in memory for the short time it is needed - not throughout the life of the application.
You can declare all your connection string etc as constants in a common module for each procedure to call which would cut down some coding for you...
VB Code:
Function xyz(b as variable) as variable open connection do stuff to database close connection End Function Function zyx(a as variable) as variable open connection do stuff to database close connection End Function




Reply With Quote