[thelist] storing connection strings in application variables

Scott Schrantz scotts at computer-vet.com
Thu Jan 24 11:15:54 CST 2002


> -----Original Message-----
> From: Chris Blessing [mailto:webguy at mail.rit.edu]
> Sent: Thursday, January 24, 2002 7:52 AM
> To: thelist at lists.evolt.org
> Subject: [thelist] storing connection strings in application
variables
>
> What I have is a development server and a live server.
> Because the machines
> are different I have stored the connection string as an
> application-level
> variable (application("connStr")).

The way I do it is I store the connection strings in an included file.
So, each page would start out with
<!-- #include file="datastore.asp" -->
Then, in datastore.asp, you could define two connection strings - one
for the orders database (connStrOrders) and one for the products
database (connStrProducts). Then, each page would use whichever
connection string it needed, depending on whether it was looking at
Orders or Products.
Your development server and live server would then only need to have
different copies of datastore.asp, with the appropriate connection
strings defined for that server.






More information about the thelist mailing list