View Single Post
  #1 (permalink)  
Old May 17th, 2005, 12:05 PM
codehappy codehappy is offline
Authorized User
 
Join Date: Apr 2005
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP connection string not working

I have an ASP page that resides on serverA and connects to the database on serverB via an ODBC. I might be doing this wrong... But when I attempt the connection I get either

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

OR

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

This is my connection string that yields the first error:

Application("conn1_ConnectionString") = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=ODBCSrc;Initial Catalog=main;APP=Microsoft Development Environment;WSID=PCWUT-AH3;DATABASE=main;Trusted_Connection=Yes"
        Application("conn1_ConnectionTimeout") = 150
        Application("conn1_CommandTimeout") = 120
        Application("conn1_CursorLocation") = 3

dim Conn ' Create and open our connection
set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionTimeout = Application("conn1_ConnectionTimeout")
Conn.CommandTimeout = Application("conn1_CommandTimeout")
Conn.CursorLocation = Application("conn1_CursorLocation")
Conn.Open Application("conn1_ConnectionString"), Application("conn1_RuntimeUserName") , Application("conn1_RuntimePassword")

This is my connection string that yields the second error:

Application("conn1_ConnectionString") = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=ODBCSrc;Initial Catalog=main;APP=Microsoft Development Environment;WSID=PCWUT-AH3;DATABASE=main"
        Application("conn1_ConnectionTimeout") = 150
        Application("conn1_CommandTimeout") = 120
        Application("conn1_CursorLocation") = 3

dim Conn ' Create and open our connection
set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionTimeout = Application("conn1_ConnectionTimeout")
Conn.CommandTimeout = Application("conn1_CommandTimeout")
Conn.CursorLocation = Application("conn1_CursorLocation")
Conn.Open Application("conn1_ConnectionString")

Any ideas?