Sql-server – Enabling Classic ASP Connection Pooling in IIS 6.0

asp-classicconnectionsiis-6sql server

We have an application running on Classic ASP which I'd like to get to use connection pooling.

The application currently uses this as its connection string:

"Provider=MSDASQL; Driver={SQL Server}; Server=db.example.com; Database=DBName; UID=Username; PWD=Password; ConnectionTimeout=15; CommandTimeout=120;" 

When I bring up the ODBC connection pooling perfmon I don't see any connections in the pool.

I've read this article which suggests setting a value in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\ASP\Parameters but there's no \ASP key so I'm not sure if it applies to IIS 6.0.

Does anyone have experience with this issue? Is there a simple way to toggle pooling on?

Best Answer

The reference article (referenced at the bottom of the article you cited) states and on IIS 4.0 and later connection pooling defaults to on. So you don't need to enable it through the registry.

From another article:

To use connection pooling optimally, there are a couple of rules to live by. First, open the connection, do the work, and then close the connection. It's okay to open and close the connection multiple times on each request if you have to (optimally you apply Tip 1) rather than keeping the connection open and passing it around through different methods. Second, use the same connection string (and the same thread identity if you're using integrated authentication). If you don't use the same connection string, for example customizing the connection string based on the logged-in user, you won't get the same optimization value provided by connection pooling. And if you use integrated authentication while impersonating a large set of users, your pooling will also be much less effective.

Making sure to close the connection and using the same connection string again is the key to connection pooling. IIS will cache the connection and reuse it (essentially).