Using dsn connection in asp include files
Hi all,
I am having some troubles using the dsn connection I have made and tested successfully in DW. I followed the guidance to create a dsn but I have created an include file to make this connection for the pages in use. However I get an error message '80004005' when I go to make the connection using the include file.
Include file
<%
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "dsn=dsnConn;"
Sub closeconn()
conn.Close
Set conn=Nothing
End Sub
%>
in another asp page I call this include file and want to use the connection to access the database table
SQL="SELECT * FROM Authors"
Set SQLIO = conn.Execute(SQL)
......
As I said earlier, the dsn is set up and is the test works. I tried doing a similar thing with the .asp file created by DW when I made the dsn connection but am unsure how I can reference and use this is the same way as I could as the variable conn in the include file as this only provides the dsn string. Below is the contents of the file created by DW on connection of the dsn.
<%
' Filename="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim dsnConn_STRING
MM dsnConn_STRING = "dsn=dsnSQL;"
%>
Any help or if you require additional information it would be greatly appreciated.
