Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 January 13th, 2008, 09:21 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
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?

Reply With Quote
  #2 (permalink)  
Old January 13th, 2008, 09:29 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,084
Thanks: 80
Thanked 1,587 Times in 1,563 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
Reply With Quote
  #3 (permalink)  
Old January 13th, 2008, 10:01 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old January 13th, 2008, 01:23 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,084
Thanks: 80
Thanked 1,587 Times in 1,563 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.
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
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



All times are GMT -4. The time now is 02:49 PM.


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