Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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?
Reply With Quote
  #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
Reply With Quote
  #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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:22 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.