ADO Global Connection does not let a local connection release DBF for 60 seconds

ADO Global Connection does not let a local connection release DBF for 60 seconds

Post by anjukkuma » Fri, 16 Jan 2004 07:08:44


I have a global ADO Connection object (either for DBF or MDB) that
gets opened on startup and have local ADO Connection object that opens
a DBF file that I open at the begining of a function and then use the
connection to open the recordset and then close the recordset, set it
to Nothing, close the connection and set it to nothing at the end of
the function. At the this point of time, the reference to the DBF
should be released and available for exclusive open, if needed.

But the reference to the DBF is not released for 60 seconds or until
the global connection object is closed and set to nothing. This
happens only with local Connection object accessing DBF and if I use a
MDB file in the function, the MDB reference gets released as soon as I
execute set cnConnection=Nothing on the local object in the function.

The DBF in the function is held for 60 seconds and during that 1
minute the DBF is not availble for exclusive access. I wonder why this
happens with the DBF! Is it something to do with DBF driver (I am
using Microsoft Visual FoxPro driver)? Memory leak in ADO?

The references get released on WinNT machine but I am using Win2000
and ADO 2.6.

Please Help!!!!!!
 
 
 

ADO Global Connection does not let a local connection release DBF for 60 seconds

Post by Stephen Ho » Fri, 16 Jan 2004 09:38:43

> The references get released on WinNT machine but I am using Win2000

I have never used the Visual FoxPro Driver. But two things I can think of
that are worth doing:

1. Dump the Connection's Properties before/after a successful Open. You want
to dump the name and value. The number of Properties expands after a
successful Open(). It could be that Visual FoxPro Driver has a dynamic
property called, say, "ReleaseConnectionTimeout" that is of value 60. Who
knows?

This link may help
http://www.yqcomputer.com/

2. ADO supports this concept of Connection Pooling. This could interfere. It
could be it is switched on for your Win2000 machine and switched off on your
WinNT machine. Have a look here

http://www.yqcomputer.com/

and read under "OLE DB Pooling". This statement in the doucmentation seems
relevant:

"The time-out value is set to 60 seconds; this value cannot be configured in
OLE DB resource pooling prior to the release of MDAC 2.5."

I am no expert, but I would poke with a sharp stick in the Registry, examine
what is offered by Connection object under Visual FoxPro and read all
Microsoft articles and compare with documentation. If "Connection pooling"
turns out to be right, my guess would be you want to manually override
whatever the state of Connection pooling is on a particular Windows machine
for consistency. Looks to me like you want "OLE DB Services=n;" in the
Connection string somewhere before you open. If you dump the Connection
properties on both Windows machines after a successful Open(), it should
show what this property is set to.

Hope this helps

Stephen Howe