Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 3rd, 2004, 11:00 AM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ameg
Default Login failed for user 'sa'

I have 3 Virtual directories in my IIS, two are working fine. The one that brought home from work to work on gave me the Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'sa'.
/_Devel/login.asp, line 5
I am clueless. Please help
Alexis
  #2 (permalink)  
Old April 5th, 2004, 02:00 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: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Alexis,

(I'll answer here, instead of replying to your personal message, if you don't mind).
How did you set up SQL Server? Is it using Mixed Authentication, or Windows only authentication? You can check that on the Properties dialog for SQL Server in the Enterprise Manager.

The error you get makes me think that SQL Server is using Windows Authentication, but that your connection string in your ASP page is using the SA account, and is not using Integrated Security / a Trusted Connection.

If that is the case, either switch the security model for SQL Server to SQL Server Authentication (IMO, not recommended), or change your connection string so it uses a trusted connection. Take a look here for ideas on connection strings:

http://www.able-consulting.com/MDAC/...erForSQLServer

and search this forum (or Google) for "Login failed for user sa" for much more background on this problem. It has been reported many many times, so you can find quite a lot of information and fixes in the archives of this forum.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old April 5th, 2004, 09:08 AM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ameg
Default

Thanks Imar,
I need to clarify myself more about the issue:
I have 3 DB(s) running at home right now.
2 of which are my own developing.
I also have one separate DB at work that I developed _ It worked fine at work at this point.
My Home machine had only MSDE installed.
However backup work's DB and moved it to home machine. And after that I installed SQL 2K (Client Side only) in to the home machine.
My other 2 home DBs are still up and running fine. But the work's DB.
Further more, I have no problem attach work's DB using Query Analyzer.

EM properties has set to Mix Mode. I think you are right about the connection string. I'll check on that and may be trying the switch the security model for SQL Server to SQL Server Authentication as you suggested at later time today.
Thanks again.
I'll post the result here later.

Alexis





  #4 (permalink)  
Old April 5th, 2004, 09:14 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: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

In that case, check the password for the SA account. Maybe your home server uses a blank password, and the work application used an SA account *with* a password.

In either case, it's not recommended to a) use the SA account and b) use a blank password.
If I were you, I'd create a separate user with just enough privileges (either a SQL user or a Windows user) and use that account to connect to the database.

Just a thought....

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #5 (permalink)  
Old April 5th, 2004, 08:36 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ameg
Default

Dear Imar,
You are an expert _ I reasigned PW for SA to the same as windows PW _ Problem solved.
I got log in work's DB perfectly.
I know you are not recommended the SA account but I needed to learn more on the Security issue before I could going further.
I'll put the note to this and doing more research.
Thanks so much Imar.
I was not wrong about your expertise after all.. :-))

  #6 (permalink)  
Old April 6th, 2004, 01:52 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: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Right. That sounds a bit like the pilot of the Boeing 747 I am in saying: "We'll figure that landing part out later, first we gotta focus on flying".... ;)

IMO, security is a structural part of an application, not something you add on later. In learning, you may postpone it until after you understand some other important concepts, but it's never too early to start understanding security, and to follow good security practice, like not using the SA account.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 


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
Login failed for user 'sa' scarlisle BOOK: ASP.NET Website Programming Problem-Design-Solution 3 November 29th, 2009 09:51 AM
Login Failed for User sa r_taduri Crystal Reports 1 November 29th, 2009 09:50 AM
Login failed for user 'sa'. Reason: Not associated Saurabh Sharma Classic ASP Basics 0 October 23rd, 2007 01:37 AM
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 'sa'. ernestlambert BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 7th, 2005 12:26 PM



All times are GMT -4. The time now is 10:57 PM.


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