Wrox Programmer Forums
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 20th, 2004, 12:16 AM
Registered User
Join Date: Sep 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Best way to connect to the data base Is it Appl...

What is the best way of connecting to a database? Is it creating an application level variable which is shared by all users ? Or is it a session level variable for each session ? Or is it a connection in each procedure ? Or Should it be like opening the connection when the database is accessed and closing it immediately which means multiple opening and closing in the same procedure.

:( I am really confused. Somebody please help

Old October 20th, 2004, 09:23 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Hi Jojy,

IMO, It is good to have the connection open only when the DB access is required and close that once you are done with DB operations. If there is a sequence of opetations to be done with the database within a procedure/function, then it might be good that open the connection once the control enters the procedure and close that before the control exits from there. So far I have been sticking to this way of approach. But should be careful in closing connection then and there after use.

When Application/Session level db connection are used, then the connection per user is open till the time user quits the site, even when the user is roaming around the static pages.

May be you would get good inputs from others in this forum too.

Hope that helps.

- Vijay G
Strive for Perfection

Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Base Error anees ASP.NET 1.0 and 1.1 Professional 6 May 27th, 2008 09:02 AM
attach data base angelboy SQL Language 1 May 30th, 2007 11:07 AM
Transfering data from csv file to data base g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 2 May 16th, 2006 11:58 PM
Data Base Connection ashraf Javascript 4 November 27th, 2004 06:56 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.