views:

216

answers:

1

Hi,

I'm new to windows services and... you guessed it, I’m a bit stuck. Let me paint the picture –

I’m running a timed service that use an OdbcDataReader and SqlBulkCopy to (1) archive the data (2) normalize the data on a SQL box. When I run this code in a windows form proj. it works fine. Then, when I change the DNS’s Data Directory Path to a local drive, instead of the network share (just simulated the environment locally), it works as well.

I’m obviously missing something. Any help will be appreciated.

DNS

A: 

When you run the windows form project it runs using your login account. The service runs using the LocalSystem account which probably does not have rights to access the network share specified in the ODBC settings.

You can check this by going into the Services Properties->Log On tab and make it run using your account. If it works then it probably was an access rights problem.

I would recommend creating a user account that just has enough access rights to access the share.

Carrick