Link to home
Start Free TrialLog in
Avatar of Bigimpact
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
%>

Open in new window

Avatar of dosth
dosth
Flag of India image

in your code where you are opening connection to the database some thing like

      set Connection = Server.CreateObject("ADODB.Connection")
      Connection.Open MM_connArtsvibe_STRING
Avatar of Bigimpact
Bigimpact

ASKER

The server simply doesn't recognise my DSN. I have changed code to this:

<%@LANGUAGE="VBSCRIPT"%>
<%
Set objConnection = CreateObject("ADODB.Connection")
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
Avatar of dosth
dosth
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks for the points