What is the preferred method of ADO connection creation?
Should the ADO connection be created within Global.asa file, and stored in application object, for everyone to use, or should connection be created and close, each instance it is required?
In order to use connection pooling (the most efficient approach), I store my connection string in an application variable (created in the global.asa application_onStart). Then create, open, and close the connection on each page as needed.
set objConn = server.createObject("adodb.connection"
objConn.open(application("connStr")
set rs = objConn.execute("select fieldName from TableName"
objConn.close
set objConn = nothing
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.