I have a include called inc_func.asp which is called at the top of every page.
This is the code used for accessing or opening the database.
Code:
Sub OpenDB()
' Opens a new ADO connection
' sConnLoc = "PROVIDER=" & dbProvider & ";DATA SOURCE="& dbPath & ";"
sConnLoc = "Provider=SqlOLEDB;Network Library=DBMSSOCN;" & _
"Data Source=HYDROGEN;" & _
"Initial Catalog=xxxxx;" & _
"User Id=xxxxx;" & _
"Password=xxxxx"
If Not ConnectionExists() Then
' Open a database connection
Set conn = Server.CreateObject("ADODB.Connection")
' Response.Write(sConnLoc)
conn.Open sConnLoc
' The next line is for compatibility with existing code...
OpenRS
'OpenCmd
End If
End Sub
If I have missed anything out apologies.
Bookmarks