At present I am connecting to the SQL Server DB on each page that uses it. I have been informed that creating a database.inc for example to contain the database connection and including it on relevant pages is unsecure, and I should use the global.asa. But I cannot get this to work.
at present I have this in each page
What do I need to use in global.asa and what should stay on each page?
Thanks folks
at present I have this in each page
Code:
Set objConn=Server.CreateObject("ADODB.Connection")
cs = "Driver={SQL Server};Server=(local);Database=myDB;Trusted_Connection=yes;"
objConn.open cs
SQL = "SELECT * FROM mytable order by title"
set rs = server.CreateObject("ADODB.RECORDSET")
rs.open SQL,objConn
What do I need to use in global.asa and what should stay on each page?
Thanks folks