[thelist] stuck in a loop (classic asp/mssql)

Ken Schaefer Ken at adOpenStatic.com
Mon Aug 22 23:43:52 CDT 2005


: -----Original Message-----
: From: thelist-bounces at lists.evolt.org [mailto:thelist-
: bounces at lists.evolt.org] On Behalf Of Brian Cummiskey
: Sent: Tuesday, 23 August 2005 1:39 PM
: To: thelist at lists.evolt.org
: Subject: Re: [thelist] stuck in a loop (classic asp/mssql)
: 
: Ken Schaefer wrote:
: 
: >Why are you opening two connections?
: >
: >
: good question.  I didn't even notice that...
: 
: >Surely:
: >	comm.ActiveConnection = connstr1
: >should be:
: >	Set comm.ActiveConnection = oConn
: >?
: >
: >
: >
: I'll have to play with this at the office tomorrow.  It works in its
: current state though.  I'll see what i come up with tomorrow.

Yes, it works at the moment. You are opening one connection (oConn), and then
you are opening another connection implicitly. However, because you are
opening it implicitly, you are not returning it to the OLEDB Resource Pool
when you call Set comm = Nothing. As such, this type of code will not scale.

See Pooling in the Microsoft Data Access Components:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmdac/html/
pooling2.asp
for information on ODCB Connection Pooling/OLEDB Resource Pooling

and

INFO: Connection Pool Management by ADO Objects Called From ASP
http://support.microsoft.com/?id=191572
for why what you are doing is a bad idea.

Cheers
Ken


More information about the thelist mailing list