Using text file to create DSN connection

Results 1 to 2 of 2

Thread: Using text file to create DSN connection

  1. #1
    Bruce A Smith Guest

    Default Using text file to create DSN connection

    I would like to know how to use a text file to connect to a server. For example, instead of hard coding the following lines:<BR><BR>srtconn="Driver={SQLServer};Server=1 11.222.333.4444,;UID=id PWD=password;DATABASE=appsdb"<BR>set Myconn = server.createobject("ADODB.Connection")<BR>Myconn. open srtconn<BR><BR>I would like to be able have my asp code point to a text file that would create my connection. In this way, if the server ever went down or I wanted to change servers, I would only need to change the connection in text file and not in multiple asp pages.<BR><BR>Thank you

  2. #2
    Jason Buck Guest

    Default RE: Using text file to create DSN connection

    Yes, it is very posible. Just include it as an include.<BR><BR>The following is how I do it. I call it dbcon for database connection.<BR><BR>&#060;!--#include virtual="/web/dbcon.txt" --&#062;<BR>You will have to remember to close your connection or make a close connection file to include at the end of you page.<BR><BR>Respectfully,<BR><BR>Jason<BR>webmast<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts