Solved service and dbf file on network share

Posted on 2004-11-08
Last Modified: 2012-05-05
I've written an window service in
It needs to read our dbf files that are stored on a network share, but whenever it runs it says it cant find the file.
it runs fine if the file is on the local machine, but not when i connect it to the live system (on the network share).
i think this is something to do with the dotnet security settings, but can this be changed? and how?

Question by:rpter
    LVL 11

    Assisted Solution

    Usually a Service is executed under the "local System" account.

    You need to change this account to your own account or a Service account that has sufficient rights in your network, so it can read the files. The local system wont be allowed to access any network shares (well most likely) You can also do it the other way around and add the local system account from your PC to the network shares.

    Hope this helps :)
    LVL 4

    Accepted Solution


    The question is : which user tries to access the file ?

    If your service runs under LocalSystem account, then you cannot see the network shares. You would then have to change the connection settings for your service. If you are inside a domain, you'll have to run the service from an existing user account that is part of the domain, and that have the rights to access the shared folder, where your .dbf file is. You can choose and configure this account in the services panel of the windows control panel.

    Of course, you can also create an account only for this task, and fine tune its grants as you wish.

    Other point : You cannot access network drives in a service application. Use \\MACHINE\FOLDER\ instead of X:\...


    Author Comment

    it was the user access and the network drive.

    Thank you.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now