By default ASP does not take advantage of this ability. To turn this feature on you will have to update the Registry and manually adjust the appropriate key. This can seem a daunting task. However, it is really very straightforward and the performance benefits can be well worth the effort.
Note for IIS users: Unless you install Microsoft Windows NT Service Pack 2 (SP2) or later, using Microsoft Access with connection pooling enabled may cause system failures when shutting down IIS.
To edit the Registry, run the REGEDIT
utility. You will need to modify the following registry entry:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\ASP\Parameters
Find the StartConnectionPool
entry and change the value from 0
to 1
. For example:
Once you have made this change, the ADO and ASP will take advantage of their ability to hold open frequently-used connections between sessions. However, we now need to consider whether, and to what extent, the data source we are attaching to can support connection pooling. If your data server is Microsoft SQL Server, you'll want to take into account which underlying network library is being used to support a connection. Let’s take a look at the changes that we should made to the SQL Server environment to support connection pooling with ADO.
In order to take advantage of connection pooling when using SQL Server, the TCP/IP or Multi-Protocol network library must be used. In most cases, as we are developing an Internet or Intranet based solution, TCP/IP will be the default underlying network library in use at our site. However, to verify the library in use, use the SQL Server Client Configuration utility. Remember that even if the Web Server and SQL Server are running on the same physical system, the Web Server (and thus our ASP pages) is still a client of SQL Server.
The SQL Server Client Configuration utility is an easy-to-use GUI tool that displays the DB Library and NET Library defined for use on the machine, along with any DB LIB-defined names tied to a specific library. (DB LIB is the native database library supplied with SQL Server and Sybase). As ASP interacts with ODBC and its underlying SQL Server driver, no changes are required to the DB LIB settings. However, both DB LIB and ODBC communicate with SQL Server using an underlying Net Library driver.
To configure a client system (in our case the Web server) to use the TCP/IP Net Library when communicating with SQL Server, we click on the Net Library tab, and under Default Network select TCP/IP Sockets.