Add new users to SQL Server mdf

W

weird0

How can i add new users to the sql server mdf. Since, when i try to
access the mdf it gives me
the following error under the setting "Windows Authentication":

" Could not open default database.Login failed for user AMIRDIWAN
\Administrator"

Alternatively, i tried the other way by keeping "SQL SERVER
Authentication":

" Login failed for user 'amirdiwan'.The user is not associated with a
trusted SQL Server connection."


How can i fix this. Please let me know, as i have to do it for my
final year project?
 
D

David Browne

weird0 said:
How can i add new users to the sql server mdf. Since, when i try to
access the mdf it gives me
the following error under the setting "Windows Authentication":

" Could not open default database.Login failed for user AMIRDIWAN
\Administrator"

Alternatively, i tried the other way by keeping "SQL SERVER
Authentication":

" Login failed for user 'amirdiwan'.The user is not associated with a
trusted SQL Server connection."


How can i fix this. Please let me know, as i have to do it for my
final year project?

First, although this is homework, I don't imagine solving this particular
problem is part of the assignment.

What version of SQL Server are you using? What version of Windows?

Is the instance of SQL Server on your local computer?

Do you have another local administrator account that you can try to connect
from?

David
 
W

Willy Denoyette [MVP]

weird0 said:
How can i add new users to the sql server mdf. Since, when i try to
access the mdf it gives me
the following error under the setting "Windows Authentication":

" Could not open default database.Login failed for user AMIRDIWAN
\Administrator"

Alternatively, i tried the other way by keeping "SQL SERVER
Authentication":

" Login failed for user 'amirdiwan'.The user is not associated with a
trusted SQL Server connection."


How can i fix this. Please let me know, as i have to do it for my
final year project?


SQL server logins aren't "Windows logins", so if you are using Windows authentication
(integrated security) you'll have to create windows accounts, when using SQL logins you have
to create SQL accounts. Note that you can also confifigure SQL server to use both SQL and
WIndows authentication, in which case you can use a mix of both.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top