PDA

View Full Version : MS Access Vs SQL Server


john_a_antoniou
11-15-2004, 09:02 AM
I'm using asp.net with MS Accessand I noticedhttp://community.discountasp.net/emoticons/cry.gif that I need to close the connection (MANUALLY)after the use because I can have only 64 open connections. Does SQL Server needs to close the connections manually or automaticaly?How many open connections does SQL Server support?

bruce
11-15-2004, 10:47 AM
You always want to close the database connection after the application is done using it regardless if you use MS Access or MS SQL.

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

bluebeard96
11-16-2004, 05:30 AM
Bruce... I have to give you credit for showing great restraint and not going into your "don't use access" argument (as valid as it is).


Bruce is right, you always want to close your connections. Some people can semi-effectively use Access to drive their websites, but it is even MORE imperative to close connections in Access, as there is a limited number of concurrent connections (as you have found out). If you open the connection, run your query, use your data, then close your connection right away, you can get it working pretty well.


So not only is your code cleaner, it runs better as well.



Mike Reilly, Secretary/Webmaster
Kiwanis Club of Rancho Penasquitos
"Serving the Children of the World"
Mike@KiwanisPQ.org
(760) 419-7429

bruce
11-16-2004, 07:48 AM
Closing connection is one of 'must do' regardless what database backend you are using.

Many think that ASP.NET has automatic garbage collection but GC doesn't kick in real time, you will run into problem if you have a very busy site.

MS SQL can take up to 64K of connections but the connection pool on the web server will run out of space and you will get a very ugly error.

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)