SQL 2005 cannot open user default database. Login Failed Error:4064

Just installed SQL 2005...I am trying to setup a user so that they have a default database that I will use in the connection string in my .net ASP code...I have created the login, gave them access to the db, set the db as their default db...Then when I try to connect to SQL 2005 using their login, I get 'Cannot connect to localhost. Cannot open user default database.  Login failed. Login failed for user 'maguser' (Error:4064).  I have seen the emails to alter user and set it to master...but I want it to default to my other DB...so that my connection string will work when I specify the db in it...
cenetadminAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Faiga DiegelSr Database EngineerCommented:
hae you tried enrolling that user to a specifi database?

USE [DatabaseName]
GO

CREATE USER [maguser]
FOR LOGIN [maguser]
WITH DEFAULT_SCHEMA = [dbo] /*or whatever default schema you have setup*/
GO
0
NazoUKCommented:
Have you set the logon mode of sqlserver to allow sql server authentication? The default is windows authentication only.

In SQL Server Management Studio right click your server, choose properties then in the security tab change logons to allow windows and sql server authentication
0
cenetadminAuthor Commented:
I have the login authentication setup correctly for my SQL 2005...The issue seems to be that I have Attached the db's and the users already exist in the db's...
0
maradamCommented:
You don't need to set default database for login if you also set it in connection string.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.