I have tried many different ways to connect to a SQL Server db but can't get any to work. I am logging in through VPN and then remote desktop onto a machine and am working directly on the machine (there's no external IP address). It's SQL Server 2005 and Windows Server 2003.
Each way I tried seems to point to a login issue. The last way I tried, setting up an ODBC connection, seemed like it was going to work. Using Windows NT authentication, the connection tested successfully. However, when I used that DSN in my ASP page, I got an error: Login failed for user ARAGORN\USR_ARAGORN. The system administrator said it's trying to use the IUSER account on the local machine (ARAGORN). I then changed the authentication to SQL Server and entered my domain account, but when I press Next, I get an error saying: "Login failed for...User is not associated with a trusted SQL Server connection".
I have only worked with ASP to SQL Server on hosts where the connection is pretty obvious or I am able to create a new user and just use that login. I tried creating a new user on this machine and used that user/password but got the same error as when I use my own login.
I would also like to not use a DSN and use the connection string directly in ASP but I couldn't get anywhere with that.
I can see that ASP is working. I can write ASP lines and see them in the browser. But as soon as I put a connection line, the page doesn't work. At least with the DSN, the page didn't totally bomb and I could see the ASP lines displayed and the error message on the line with the DSN call, which is line 17.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>My title</title>
</head>
<body>
<p> hello there world!</p>
<%
response.write "hello from asp<br>"
response.write "hello again from asp"
' Set db Connection
set ref = server.CreateObject("ADODB.Recordset")
ref.ActiveConnection = "DSN=intranet;" 'line 17
ref.Source = "SELECT test FROM mytest"
ref.Open()
'set the cursor to the first record
ref.movefirst
'Get all the lastnames on the screen
While NOT ref.EOF
Response.Write(ref("test")&"<br>")
ref.movenext
wend
%>
</body>
</html>
Any suggestions are appreciated. I feel very stupid. I have checked all over this forum and others and can't get it to work.
Thanks,
Alexis
Each way I tried seems to point to a login issue. The last way I tried, setting up an ODBC connection, seemed like it was going to work. Using Windows NT authentication, the connection tested successfully. However, when I used that DSN in my ASP page, I got an error: Login failed for user ARAGORN\USR_ARAGORN. The system administrator said it's trying to use the IUSER account on the local machine (ARAGORN). I then changed the authentication to SQL Server and entered my domain account, but when I press Next, I get an error saying: "Login failed for...User is not associated with a trusted SQL Server connection".
I have only worked with ASP to SQL Server on hosts where the connection is pretty obvious or I am able to create a new user and just use that login. I tried creating a new user on this machine and used that user/password but got the same error as when I use my own login.
I would also like to not use a DSN and use the connection string directly in ASP but I couldn't get anywhere with that.
I can see that ASP is working. I can write ASP lines and see them in the browser. But as soon as I put a connection line, the page doesn't work. At least with the DSN, the page didn't totally bomb and I could see the ASP lines displayed and the error message on the line with the DSN call, which is line 17.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>My title</title>
</head>
<body>
<p> hello there world!</p>
<%
response.write "hello from asp<br>"
response.write "hello again from asp"
' Set db Connection
set ref = server.CreateObject("ADODB.Recordset")
ref.ActiveConnection = "DSN=intranet;" 'line 17
ref.Source = "SELECT test FROM mytest"
ref.Open()
'set the cursor to the first record
ref.movefirst
'Get all the lastnames on the screen
While NOT ref.EOF
Response.Write(ref("test")&"<br>")
ref.movenext
wend
%>
</body>
</html>
Any suggestions are appreciated. I feel very stupid. I have checked all over this forum and others and can't get it to work.
Thanks,
Alexis