Re: closing DB connections

Tech-Archive recommends: Fix windows errors by optimizing your registry



good stuff..

'will the last one leaving visual basic please turn off the lights'

-Aaron


onedaywhen wrote:
aaron.kempf@xxxxxxxxx wrote:

I disagree with this and I haven't seen it in the real world.

basically.. a little bit of a memory leak isn't that big of a deal and
from where I am standing there is no ROI on making this change; and
thus becoming a slower developer-- because I've never had a problem
with ADO.

if you do the same thing in Access _ONCE_ with DAO you are going to get
a hang

I don't agree with this [...]; I don't need to explicitly close
anything.

As regards *closing*, I know from experience that letting a ADODB
Connection go out of scope will close the connection without problem
when using SQLNCLI, SQLOLEDB or Microsoft.Jet.OLEDB.4.0 but I don't
know whether this behaviour is ADO- or provider-specific.

As regards setting to Nothing, I am already in the habit of doing this
only when necessary. Consequently, I this code that frequently catches
my eye:

con.Close
Set con = Nothing ' release possible connection pooling

I suspect I had a problem once with connection pooling and the
'workaround' was to set the connection to Nothing, being something I
would not normally do. The aforementioned article seems to confirm
this.

In other words, there are exceptions to every rule and - don't take
this personally, it's not your fault - you sometimes have to do things
'manually'. Yes, you have to do this _all the time_ in DAO and in my
experience only very infrequently in ADO.

Other than that, you seem to have mistaken me for someone who uses DAO
but I accept your apology in advance ;-)

I am outraged that you [others] take your bad experiences with DAO
and transfer them to ADO and VB6.

Amen.

Jamie.

--

.



Relevant Pages

  • Re: Different response times...
    ... Don't use an OLEDB connection. ... I'm partial to DAO - various comparison tests done w/ ... DAO & ADO show that DAO is as fast as or faster than ADO. ... A trick that sometimes increases connection speed w/ .mdb files is to ...
    (microsoft.public.access.queries)
  • Re: Which references to use?
    ... connection issues and I want to see if ADO works better than DAO. ... accdb they're using is an Access front-end linked to SQL Server. ... ADO is not as dead as some would like since my Access 2007 VBA ... ADO may be a better solution for this type of database then DAO. ...
    (comp.databases.ms-access)
  • Re: Which references to use?
    ... connection issues and I want to see if ADO works better than DAO. ... accdb they're using is an Access front-end linked to SQL Server. ... ADO is not as dead as some would like since my Access 2007 VBA ... ADO may be a better solution for this type of database then DAO. ...
    (comp.databases.ms-access)
  • Re: Use ADO in Access 2000?
    ... There are some things you can _only_ do with DAO. ... CodeProject returns the connection to wherever the code ... Is this why I can't find a single example> of connecting to the current Access database using ADO? ...
    (microsoft.public.access.modulesdaovba)
  • Re: Word Form Fields - Can you Export to Excel Spreadsheet?
    ... supply an "OLE DB provider". ... The other possibility is a DAO connection. ... with Excel than ADO, IMO. ...
    (microsoft.public.word.docmanagement)