?
Solved

Windows Service Problem

Posted on 2005-04-21
7
Medium Priority
?
158 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:rossc007
  • 2
  • 2
4 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 13833456
Hi rossc007,

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
0
 

Author Comment

by:rossc007
ID: 13833537
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

0
 
LVL 43

Accepted Solution

by:
TimCottee earned 2000 total points
ID: 13833870
rossc007,

If you run the services.msc either from a command line or by going into "administrative tools" from the control panel, you can select your service and set the the account details under which the service is run.

Tim
0
 

Author Comment

by:rossc007
ID: 13834316
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
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question