rossc007
asked on
Windows Service Problem
Hi All,
I have developed an application that uses a number of xml schema's to handle data updates, selects etc. The application runs fine however when I put the same code into a windows service timer event the connection falls over with a "login failed for user DomainName\MachineName". The connection string I am using is the same as in the application so I'm not sure why the DomainName\MachineName is coming up in the login failure message.
Any help much appreciated
Regards
Ross
I have developed an application that uses a number of xml schema's to handle data updates, selects etc. The application runs fine however when I put the same code into a windows service timer event the connection falls over with a "login failed for user DomainName\MachineName". The connection string I am using is the same as in the application so I'm not sure why the DomainName\MachineName is coming up in the login failure message.
Any help much appreciated
Regards
Ross
ASKER
Hi Tim,
I've tried the user name and password in my connection string, and as before it ran perfectly from the application, but failed on the service. I dont think it will make any diffence but I would like to try your first suggestion, how do I run the service from a domain account?
Cheers
Ross
I've tried the user name and password in my connection string, and as before it ran perfectly from the application, but failed on the service. I dont think it will make any diffence but I would like to try your first suggestion, how do I run the service from a domain account?
Cheers
Ross
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Tim,
Thanks for that, seems to have done some good but I'm still getting problems. The Login Failed message has gone but I am now getting a message saying that the system can't find the Stored Procedure I'm looking at, also another error saying invalid field name on a differnet adapter. I'd imagine from the results that the login is along the right track but I'm using my login for the service and I have full access to the DB. I see that some services run as network service, perhaps thats the key.
Regards
Ross
Thanks for that, seems to have done some good but I'm still getting problems. The Login Failed message has gone but I am now getting a message saying that the system can't find the Stored Procedure I'm looking at, also another error saying invalid field name on a differnet adapter. I'd imagine from the results that the login is along the right track but I'm using my login for the service and I have full access to the DB. I see that some services run as network service, perhaps thats the key.
Regards
Ross
Probably because the service is running under the localsystem account and you are using integrated security. This is a common issue with services, you have to either run the service under a domain account that has the appropriate security permissions or use SQL security rather than integrated security and specify the user name and password within your connection string.
Tim Cottee