Bigimpact
asked on
Non standard DSN problem on win2k3 server
I'm getting the dsn not found thang, but I'm a pro - the connection works in odbc manager, but I can't get any page on the server to hook up with a dsn. Its a new server, the same code used to work fine on the old server. Could it be something in MSDE / sqlserver express thats preventing the dsn being recognised? Do certain extra permissions need enabling? It's got me stumped!
<%@LANGUAGE="VBSCRIPT"%>
<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_connArtsvibe_STRING
MM_connArtsvibe_STRING = "dsn=dsnRelishSafe;"
%>
<%
Dim rsArtvibes
Dim rsArtvibes_numRows
Set rsArtvibes = Server.CreateObject("ADODB.Recordset")
rsArtvibes.ActiveConnection = MM_connArtsvibe_STRING
rsArtvibes.Source = "SELECT * FROM orders"
rsArtvibes.CursorType = 0
rsArtvibes.CursorLocation = 2
rsArtvibes.LockType = 1
rsArtvibes.Open()
rsArtvibes_numRows = 0
%>
ASKER
The server simply doesn't recognise my DSN. I have changed code to this:
<%@LANGUAGE="VBSCRIPT"%>
<%
Set objConnection = CreateObject("ADODB.Connec tion")
objConnection.Open "DSN=dsnRelishSafe;"
objConnection.Close
%>
I get the same error, dsn not found, yet the system dsn works and connects fine in odbc management.
<%@LANGUAGE="VBSCRIPT"%>
<%
Set objConnection = CreateObject("ADODB.Connec
objConnection.Open "DSN=dsnRelishSafe;"
objConnection.Close
%>
I get the same error, dsn not found, yet the system dsn works and connects fine in odbc management.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
thanks for the points
set Connection = Server.CreateObject("ADODB
Connection.Open MM_connArtsvibe_STRING