And I disagree.
As I discuss at length in Chapter 9 of my book and all of my previous (11)
books, if you want to take advantage of client/server architecture and the
ability to manage server state, you need to keep the Connection open. There
are any number of powerful features that can only be implemented with a
persistent connection. Features like server-side cursors, #tempdb indexed
tables to be used in JOINs and more.
While the need to open query and close exists for ASP applications, it's not
necessary for client/server applications. Yes, this approach limits
scaling--to about 1000 users.

Signature
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
>
>> Hi all,
[quoted text clipped - 60 lines]
> hth
> -ralph
Ralph - 12 Dec 2007 19:19 GMT
> And I disagree.
> As I discuss at length in Chapter 9 of my book and all of my previous (11)
[quoted text clipped - 7 lines]
> necessary for client/server applications. Yes, this approach limits
> scaling--to about 1000 users.
Even though I highly recommend your book, IMHO you are misguided on this one
subject. (Well I also disagree with your blanket condemnation of DAO, but
that is another topic. <g>)
All the issues you are talking about take place at the Provider-Engine
level. At the App-ADO level, all an ADODB.Connection.Open/Close does is make
a request for a connection with additional attributes, or notify the pool
that a particular connection is no longer needed. I think you will find the
Close request is less deterministic than one thinks.
For the scenarios you are describing a programmer will likely not request a
connection to be closed. The ability to know when and how defines a 'Best
Practice' and is the reason I suggested your book. To keep a
ADODB.Connection object always open because one *might* be dealing with a
server-side scenario is as silly as adopting a policy to always immediately
close an open connection irrespective of the scenario. Besides the *App* is
going to 'lose' the connection anyway after any period of inactivity.
Also while, as you noted, Open/Close is important in ASP and less important
in a simple client/server, it can become important again in Laptop/Mobile
applications or apps running in a noisy/busy environment - anywhere where a
continuous connection is not guaranteed.
I like to manage my App's view of the state of the connection at the point
of attack. However, like the man said - "Horses for courses". <g>
-ralph