Benutzer mit den meisten Antworten
login failed when accessing with windows service

Frage
-
Hi,
I have a problem accessing an SQL 2005 Express database with a Windows service. The following is the connection string:Server=MYMACHINE\SQLEXPRESS;Initial Catalog=MyDb;User Id=myUser;Password=myUser;
"myUser" is configured as User under Security of the Database "MyDb".
When I am logged in and start the service, the login is no problem. But when restarting the server, the service reports a login failure for the database.
The Sql server is configured for Mixed authentication. The account in the connection string works. I can connect with the management studio with this user.
I have no idea why the service cannot access the database when the server starts and why the service can access the database as soon as I am logged in on the server.
Best regards and thanks for any help.
Antworten
-
The Problem is solved. According to Thread http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/85ef8cbc-4235-499a-bd64-bf424336d1a5 I have set the default database for the service user and now the login succeeds when starting automatically.
- Als Antwort markiert Yannik Steiger Dienstag, 11. Januar 2011 11:13
Alle Antworten
-
Hoi Robert
Die meldung lautet in etwa: "The database "MyDb" could not be opened. The login failed for user 'myUser."
Inzwischen habe ich den Verdacht, dass das ein maschinen spezifisches Problem ist. Ich konnte den fraglichen Windows Service auf einem Virtuellen XP und einem echten Windows 7 installieren und der kann beim neustart problemlos auf die lokale MS SQL 2005 Express datenbank zugreifen.
Beim Installieren des SQL Server 2005 Express gibt es am Anfang eine option, ob man benutzern ohne admin rechte erlauben will, eine eigene Instanz zu starten.
hat dies evtl. Einfluss auf das loginverhalten von Windows Services beim systemstart?
Gruss und dank
Yannik
-
The Problem is solved. According to Thread http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/85ef8cbc-4235-499a-bd64-bf424336d1a5 I have set the default database for the service user and now the login succeeds when starting automatically.
- Als Antwort markiert Yannik Steiger Dienstag, 11. Januar 2011 11:13