M
MasterChief
I have a OLEDB Connection String that is working very well for me. My
question is that I read that you can store the Connection String in a
seperate include file or somewhere else. I am just wondering where is
the proper place to store this Connection String and how do I call it
from my application.
My Example is below
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.RecordSet")
Conn.Open "Provider=SQLOLEDB; Data Source = TEST\SQLEXPRESS; Initial
Catalog = TestSQL; User Id = sa; Password = test"
sSQL = "SELECT * FROM Html ORDER BY HtmlName ASC"
Set Rs = Conn.Execute(sSQL)
Do While NOT Rs.EOF
Rs.MoveNext
Loop
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
Would the answer be to put
Conn.Open "Provider=SQLOLEDB; Data Source = TEST\SQLEXPRESS; Initial
Catalog = TestSQL; User Id = sa; Password = test"
into an asp page and then use <!--#include file="test.asp"-->
like
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.RecordSet")
<!--#include file="test.asp"-->
sSQL = "SELECT * FROM Html ORDER BY HtmlName ASC"
Set Rs = Conn.Execute(sSQL)
Do While NOT Rs.EOF
Rs.MoveNext
Loop
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
question is that I read that you can store the Connection String in a
seperate include file or somewhere else. I am just wondering where is
the proper place to store this Connection String and how do I call it
from my application.
My Example is below
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.RecordSet")
Conn.Open "Provider=SQLOLEDB; Data Source = TEST\SQLEXPRESS; Initial
Catalog = TestSQL; User Id = sa; Password = test"
sSQL = "SELECT * FROM Html ORDER BY HtmlName ASC"
Set Rs = Conn.Execute(sSQL)
Do While NOT Rs.EOF
Rs.MoveNext
Loop
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
Would the answer be to put
Conn.Open "Provider=SQLOLEDB; Data Source = TEST\SQLEXPRESS; Initial
Catalog = TestSQL; User Id = sa; Password = test"
into an asp page and then use <!--#include file="test.asp"-->
like
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.RecordSet")
<!--#include file="test.asp"-->
sSQL = "SELECT * FROM Html ORDER BY HtmlName ASC"
Set Rs = Conn.Execute(sSQL)
Do While NOT Rs.EOF
Rs.MoveNext
Loop
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing