When to Close the Connection?

  • Thread starter Thread starter Frank Dulk
  • Start date Start date
F

Frank Dulk

I developed a system in VB with Sql Server 2000
using ADO, everything this is really very satisfied with the acting of the
sql server, does mine doubt the following it is, because I see many comments
on the subject... do I possess a global variable in I modulate has the
connection with the bank.... when do I open the system I carry the bank and
only bolt in the exit... is that correct? if I use MSDE would not have q to
close the connection to use with more simultaneous users? doesn't have as
leaving the inactive connection? should I open and to close in each
transaction with the bank?
 
Hello Frank,

The general rules are:
1. If you don't need it, don't open it.
2. If something else doesn't need it, don't expose it.
3. If you don't need it anymore, close it.

Having said that, there are performance overheads associated with opening
and closing database connections., but I would still opt for resource
conservation.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Back
Top