SQL Server 2005 Express Edition login problem when deploying a windows application

P

Preben Zacho

Hi there

The scenario I got is this: I have created a Windows application in VS and I
want to deploy it to another machine running Windows Vista. Since I have no
control over this other machine, I've set it up to run SQL Authentication
and I have added a new user called "MyUser" and applied a password. This
user/password is used in my connection string whick looks like this:

Server=.\SQLEXPRESS;Database=MyDB;User ID=MyUser;Password=thissucks

I've created a setup project in which the database is included. On my
machine (Windows XP SP2) the setup runs without problems and I can use my
app and database connection without any errors. On the Vista machine, the
other user gets this error:

"Login failed for user "MyUser". The user is not associated with a thrusted
server connection".

I've read a bunch of suggested solutions on the net, none of which has
provided a solution...yet.

How do you create a deployment/Publish in VS when using SQL Server 2005
Express Edition, when the maching it's supposed to be installed on only has
..NET FrameWork? I can't seem to get it to work...

TIA

PZ
 
M

Mr. Arnold

Preben Zacho said:
Hi there

The scenario I got is this: I have created a Windows application in VS and
I want to deploy it to another machine running Windows Vista. Since I have
no control over this other machine, I've set it up to run SQL
Authentication and I have added a new user called "MyUser" and applied a
password. This user/password is used in my connection string whick looks
like this:

Server=.\SQLEXPRESS;Database=MyDB;User ID=MyUser;Password=thissucks

I've created a setup project in which the database is included. On my
machine (Windows XP SP2) the setup runs without problems and I can use my
app and database connection without any errors. On the Vista machine, the
other user gets this error:

Maybe, you're using your user-id and psw and SQL Server is set to Windows
authentication. Your user ID is trusted as part of the machine's logon
user-id.
"Login failed for user "MyUser". The user is not associated with a
thrusted server connection".

The user-id is not a trusted Windows User Id.
I've read a bunch of suggested solutions on the net, none of which has
provided a solution...yet.

How do you create a deployment/Publish in VS when using SQL Server 2005
Express Edition, when the maching it's supposed to be installed on only
has .NET FrameWork? I can't seem to get it to work...

http://support.microsoft.com/kb/889615

You may want to set SQL Server Authentication to Mixed Mode Authentication,
which is Windows or SQL Server User-id and psw authentication, if it's not
set.
 
P

Preben Zacho

Hi Arnold
Maybe, you're using your user-id and psw and SQL Server is set to Windows
authentication. Your user ID is trusted as part of the machine's logon
user-id.

I'm using the user I've created in the database scope which is called
"MyUser" and password "thissucks". I assume, when SQL Authentication is
used, the user specified in the connection string is matched against the one
in the database and not a Windows user.
The user-id is not a trusted Windows User Id.

That's what I'm looking for. User "MyUser" is NOT a windows user, so I don't
understand why it wants to authenticate it like it is.
You may want to set SQL Server Authentication to Mixed Mode
Authentication, which is Windows or SQL Server User-id and psw
authentication, if it's not set.

In the SQL Server Management Studio Express I have already marked the "SQL
Server and Windows authentication mode" under server/options/security. If
there is anywhere else this should be set, please let me know.

Any other recommendations?

/PZ
 
P

Preben Zacho

Ok thanks Arnold. I'll give it a try.

All I want is to deploy my app and database without having to care about
user authority and stuff. If possible, I would deploy my database without
any login restrictions so it would run no matter who you were, but I assume
that is not possible:

/PZ
 

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