Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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
 
Old January 13th, 2008, 09:21 AM
Registered User
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Login failed for user.

I'm getting the following error when I try to connect to MSDE from my web app:

[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'User'.

However, I can login via Enterprise Manager with the User I have created with no problems.

The user has been setup with all the appropriate permissions, etc. It's an SQL Server login and the server is running in Mixed mode.

The connection string I'm using is:

DSN=CorpEventsSQL;Uid=User;Pwd=;Password;Trusted_C onnection=yes

Now, as far as I can tell, there's absolutely nothing wrong with that string so I'm stumped!

Have I missed something?

 
Old January 13th, 2008, 09:29 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

There *is* something wrong with the connection string: you have Trusted_Connection=yes in there. With that setting the database is accessed in the context of the calling user (for example, the IUSR_MachineName account) and NOT with the user name and password from the connection string.

You should change your connection string to something like:

DSN=CorpEventsSQL;Uid=User;Pwd=;Password

For more info:

http://www.connectionstrings.com/
http://www.connectionstrings.com/?carrier=dsn

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old January 13th, 2008, 10:01 AM
Registered User
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I've now removed that, but I still have the same error.

 
Old January 13th, 2008, 01:23 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Could it be an incorrect password after all?

Or maybe User has the right password, but no access to the database defined in the DSN? Try renaming your user, and see what happens. Also, if possible, try replacing the DSN file with a "proper" connection string.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting 'Login failed for user ' Squeakrz44 VB.NET 2002/2003 Basics 0 November 18th, 2006 06:09 PM
Login failed for user 'sa' ??? reidcor BOOK: ASP.NET Website Programming Problem-Design-Solution 9 October 17th, 2006 01:04 PM
login failed for user domain\user babakwx SQL Server 2000 2 May 30th, 2006 12:28 PM
login failed for user nt authority\anonymous login rj1406 Classic ASP Databases 1 October 24th, 2004 09:15 AM





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