all groups > sql server programming > october 2005 >
You're in the

sql server programming

group:

Server Side Include


Server Side Include mt
10/26/2005 8:45:02 PM
sql server programming:
Hi Friend,

I am new to ASP with SQL 2000 connection. I need to use Server Side Include
file for connect SQL 2000 using VBScript.

According to my project, I will connect from my asp page to that include db
file using function.

I am using ODBC DSN.

If you have Server Side Include sample, please share me.

Yours,
Re: Server Side Include Bob Barrows [MVP]
10/27/2005 9:18:46 AM
[quoted text, click to view]

A better newsgroup for you to have posted to would have been
microsoft.public.inetserver.asp.db

[quoted text, click to view]
This is not recommended. See http://www.aspfaq.com/show.asp?id=2126

This is similar to what I usually do:

connectionstring.asp:
<%
dim sConnectString
sConnectString = "Provider=SQLOLEDB;" & _
"Data Source=NameOfSQLServer;" & _
"Initial Catalog=NameOfDatabase;" & _
"Integrated Security=SSP1"
%>

PageWhereConnectionIsMade.asp:

<!-- #include file="connectionstring.asp" -->
<%
dim cn
cn=createobject("adodb.connection")
cn.open sConnectString
'do stuff with connection, then
cn.close: set cn=nothing
%>

HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

AddThis Social Bookmark Button