开发者

ODBC and Windows Service

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 d开发者_StackOverflow社区rive, 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜