Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Using Include File For Connection String


Message #1 by "Larry Guayante" <larry@k...> on Thu, 2 Nov 2000 14:06:10 -0800
Is there anything wrong with using an include file to store a connection
string (i.e, disadvantages, things to watch out for)? If I need to change my
connection, it would be great to change one file instead of many ASP pages.

I use the following code:

'Include File
<!--#include file="connectinclude.inc"-->

'code in include file
<%
dim oConn
set oConn=Server.CreateObject("ADODB.connection")
strSource = "Provider=SQLOLEDB.1"
strSource = strSource & "; Data Source=xxx.xxx.xx.xx"
strSource = strSource & "; User ID=something; Password=something"
oConn.ConnectionString = strSource
oConn.Open
%>

Thanks as always for help and great advice!

Larry Guayante
Knowledge Outlook
mailto:larry@k...


  Return to Index