Link to home
Start Free TrialLog in
Avatar of sportzone
sportzone

asked on

Connection Pooling with SQL and ASP

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 />")

rstest.movenext
loop

rstest.close
set rstest= nothing
connection.close
set connection = nothing
--------------------------------------------------------------------------
ASKER CERTIFIED SOLUTION
Avatar of dwkor
dwkor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yatin_81
yatin_81

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;
Avatar of 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.