Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection object

Status
Not open for further replies.

jtseltmann

Programmer
Jan 15, 2002
149
US
Just looking for a little tip as to what is a better way to go...Is it better to open one global connection to the Current Project Connection or open and close the connection as needed? I have always done it where I open and close the connection as needed but I was curious if one single open and setting a global object would be better?

Anyone have any thoughts on this? thanks for any tips.
 
Difficult to generalize too much.

I usually have a global connection which reduces the amount of code that I need to place in individual Subs / Functions, etc. It also gives me a single point of control so that I don't have to find and change many different instances of the connection string.

On the negative side, if I need different connection properties for different parts of the application then I will go with the open / close in a particular routine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top