Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 17th, 2005, 12:05 PM
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?
  #2 (permalink)  
Old May 17th, 2005, 10:51 PM
Friend of Wrox
 
Join Date: Apr 2005
Location: Cochin, , India.
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

If you are using trusted connection and amnonymous login is enabled, 'NT AUTHORITY\ANONYMOUS LOGON' should have the rights to logon to server.

You can chage this in two ways,
Open the IIS manager, Select the project properties-> Directory security-> Anonymous login -> user name.
1)Add an SQL server user for the same user.
OR
2)Change the user name to Administrator and give the password

Prashant
  #3 (permalink)  
Old May 18th, 2005, 08:43 AM
Authorized User
 
Join Date: Apr 2005
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If I did this would it still be using the ODBC? Or is it more trusted? I don't want standard trusted connection because I want the page to point to the ODBC which has the username and password. Is that possible?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection String error in ASP picky Classic ASP Databases 1 October 19th, 2007 07:37 AM
Dynamic connection string from ASP page jayaraj Classic ASP Databases 2 July 12th, 2004 07:44 AM
Dynamic connection string from ASP jayaraj General .NET 1 July 12th, 2004 04:19 AM
ASP.NET MSDE Connection string problems Bagheer Classic ASP Databases 0 August 27th, 2003 08:02 PM
connection string to MSDE(SQL) database from ASP johngilbart BOOK: Beginning ASP 3.0 9 June 13th, 2003 06:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.