faqts : Computers : Programming : Languages : Asp : ASP/VBScript : Common Problems : Database and SQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 12 people (50%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

Is there any performance hit if DB connection string is specified in an include file?
Is it better to hard code the DB connection string in each page and close in same?

May 16th, 2000 22:49
unknown unknown, Ryan Grange


IMHO, any possible performance hit incurred by the use of an include for
establishing your connection is made up for the first time you have to
change that string.  With the string repeated in every page of your
site, you always run the risk of missing a file that needs changed.
By using an include to do my connection string, I'm able to make a
version of the include for local testing and staging and use a "live"
version of the file for inclusion to handle connections to the database
at the site.  (Since I use DSN-less connections, this is practically a
must, or I would be using global search-and-replaces every time I
uploaded something.)



© 1999-2004 Synop Pty Ltd