asp_databases thread: Finding the number of current connections to Access before connecting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Meredith Booker" <Meredith_Booker@d...>
Subject: [asp_databases] Finding the number of current connections to Access
before connecting
: I am connecting to an Access 2000 database from an ASP page.
:
: I am using ADO.
:
: Can I find out the number of current connections to my Access db before
: making another connection?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Not using pure ADO only you can't.
Underneath ADO is OLEBD (or ODBC depending on what you are using to connect
to the database). Both OLEDB and ODBC implement "connection pooling" where
they maintain a pool of open connections. When your ASP page creates and ADO
connection object, and calls the .Open method, OLEDB or ODBC hands your ASP
page an existing, unused, connection. When you call Set objConn = Nothing,
the physical connection doesn't disappear, it returns to the pool. All this
is transparent to ADO.
Pooling in the Microsoft Data Access Components
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmdac/html
/pooling2.asp
Unfortunately, Access is a file based database. There is no server component
that you can query to see how many connections it has open. You can use the
LDBView tool to interogate the .ldb file to see how many connections Jet
thinks there are open to the database.
ACC: Microsoft Jet Utilities Available in Download Center
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q176670
Cheers
Ken