Connection Pooling with SQL and ASP

Posted on 2011-10-22
Last Modified: 2012-05-12
I'm a little confused on connection pooling. Can someone tell me how to revise the following simple code so that I utilize connection pooling? Can I do it just in the connection string or is there another way?

Dim connection, strSQL, rstest

set connection = Server.CreateObject("ADODB.Connection")
connection .Open "Provider=SQLOLEDB; Data Source=Locahost; Initial Catalog=northwind; User ID=username; Password=password"

strSQL = "SELECT * FROM Customers WHERE Company = 'Test Comany' ORDER BY CompanyName asc"
Set rstest= Server.CreateObject("ADODB.Recordset")
rstest.Open strSQL, connection, 0
Do while rstest.eof = false

response.write(rstest("Firstname") & " " & rstest("LastName")  & "<br />")


set rstest= nothing
set connection = nothing
Question by:sportzone
    LVL 13

    Accepted Solution

    It would be reused automatically when you're using the same connection strings unless you disable it there.
    LVL 2

    Expert Comment

    Try this one :
    Data Source = xxxx; Initial Catalog = xx; User Id=xx; Password=xx; connection reset = true; enlist= true; min pool size=1; max pool size=999;
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Lync server 2013 Backup Service Error ID 4049 – After File Share Migration
    How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now