好奇的问题.. [英] Curious Problem..

查看:83
本文介绍了好奇的问题..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我写了一个小的Windows服务,它检查目录是否有新的

文件,一旦收到一个写入一行到日志文件,然后将

文件复制到SQL服务器。


我今天遇到了一些问题,所以一直在调试中运行它

模式 - 当我这样做并完成所有完美 - 没有任何问题 -

我删除debugger.launch()行并运行服务 - 虽然

它没有错误,数据库端似乎失败了,即没有新行是

写的......


有谁可以建议这里可能有什么问题?该服务使用了一个

数据库连接,该连接指定了在

数据库中使用的用户ID和密码,所以我的初始版本是哦,它必须是权限。很可能

错误...


该服务在LocalSystem帐户下运行。


如果有人有什么想法,我很乐意听到你...这已经很顺利

到目前为止,但是无法在调试模式下永远运行它! :o)


预先感谢您提供任何帮助 - 如果适用,将发布代码。


问候


Rob

解决方案

Rob,这可能是一个安全问题,特别是如果目录是一个网络

驱动器。我不确定,但附加调试器可以作为

交互式用户运行服务。快速测试应该是将服务作为您自己的

登录而不是本地系统帐户运行,然后查看它是否有效。


" Rob Meade < RO ******** @ NO-SPAM.kingswoodweb.net>在消息中写道

新闻:Ep ******************** @ news-text.cableinet.net ...

大家好,

我写了一个小的Windows服务,它检查一个目录是否有新的
文件,一旦收到一个写一行到日志文件,然后复制
文件到SQL服务器。

今天我遇到了一些问题,所以一直在调试模式下运行 - 当我这样做并完成它的完美 - 没有问题
all - 一旦我删除了debugger.launch()行并运行服务 -
虽然它没有错误,数据库端似乎失败,即没有新的行是
写的......

任何人都可以建议这里可能出错的地方?该服务正在使用
数据库连接,该连接指定了在
数据库中使用的用户ID和密码,因此我的首字母哦,它必须是权限。可能是错误的......

该服务在LocalSystem帐户下运行。

如果有人有任何想法,我很乐意听到你的消息...到目前为止,这已经很好了
但是无法在调试模式下永远运行它! :o)

提前感谢您的帮助 - 如果适用,将发布代码。

问候

Rob



" Chris Botha"写道......

Rob,这可能是一个安全问题,特别是如果目录是
网络驱动器。我不确定,但附加调试器可以作为
交互式用户运行服务。快速测试应该是将服务作为您自己的
登录而不是本地系统帐户运行,然后查看它是否有效。




Chris Chris ,


我可以确认它不是网络驱动器 - 我有一台服务器同时运行Windows Server 2003和SQL Server 2000作为开发框。


我会尝试你建议的登录想法 - *如果它确实可以工作,因为它需要 - b $ b应该 - 我需要做些什么才能做到工作?正如我所提到的那样,只有部分失败的是SQL更新 - 这使我感到困惑,因为我在

中指定了代码中使用的用户/密码。


任何进一步的信息将不胜感激,


问候


Rob


>正如我所提到的,唯一失败的部分是SQL更新 - 这让我很困惑

我在考虑

我在代码
中指定了用户/ pwd

Rob,我看到了这个,这就是为什么我认为你可能会咆哮错误的树。

你为什么这么认为SQL失败了?你的连接字符串是什么?


" Rob Meade" < RO ********** @ NOSPAMubht.swest.nhs.uk>在消息中写道

news:%2 **************** @ TK2MSFTNGP12.phx.gbl ..." Chris Botha"写道......

Rob,这可能是一个安全问题,特别是如果目录是网络

驱动器。我不确定,但是附加调试器可能会以交互式用户的
运行服务。快速测试应该是将服务作为您自己的登录而不是本地系统帐户运行,然后查看它是否有效。



您好Chris,
我可以确认它不是网络驱动器 - 我有一台服务器运行



Windows Server 2003和SQL Server 2000作为开发盒。
<我将尝试你建议的登录想法 - *如果*它确实可以正常工作
应该 - 我需要做些什么来使它工作?正如我所提到的那样,只有部分失败的是SQL更新 - 这让我感到困惑,因为我在代码中指定了用户/密码来确定用户/密码。

任何进一步的信息将不胜感激,

Rob



Hi all,

I have written a small windows service which checks a directory for a new
file, upon receiving one writes a line to the log file and then copies the
file to SQL server.

I''ve had a few problems with it today, so have been running it in debug
mode - when I do so and step through its all perfect - no problems at all -
as soon as I remove the debugger.launch() line and run the service - whilst
it doesn''t error, the database end seems to fail, ie, no new row is
written..

Can anyone suggest what might be wrong here? The service is using a
database connection which specifies the user id and password to use on the
database, so my initial though of "oh it must be permissions" may well be
wrong...

The service is running under the LocalSystem account.

If anyone has any ideas I''d love to hear from you...this has gone quite well
thus far but cant really run it in debug mode for ever! :o)

Thanks in advance for any help - will post code if applicable.

Regards

Rob

解决方案

Rob, it may be a security problem, especially if the directory is a network
drive. I''m not sure, but attaching the debugger may run the service as the
interactive user. A quick test should be to run the service as your own
login, rather than the local system account, and see if it works then.

"Rob Meade" <ro********@NO-SPAM.kingswoodweb.net> wrote in message
news:Ep********************@news-text.cableinet.net...

Hi all,

I have written a small windows service which checks a directory for a new
file, upon receiving one writes a line to the log file and then copies the
file to SQL server.

I''ve had a few problems with it today, so have been running it in debug
mode - when I do so and step through its all perfect - no problems at all - as soon as I remove the debugger.launch() line and run the service - whilst it doesn''t error, the database end seems to fail, ie, no new row is
written..

Can anyone suggest what might be wrong here? The service is using a
database connection which specifies the user id and password to use on the
database, so my initial though of "oh it must be permissions" may well be
wrong...

The service is running under the LocalSystem account.

If anyone has any ideas I''d love to hear from you...this has gone quite well thus far but cant really run it in debug mode for ever! :o)

Thanks in advance for any help - will post code if applicable.

Regards

Rob



"Chris Botha" wrote ...

Rob, it may be a security problem, especially if the directory is a network drive. I''m not sure, but attaching the debugger may run the service as the
interactive user. A quick test should be to run the service as your own
login, rather than the local system account, and see if it works then.



Hi Chris,

I can confirm that it isnt a network drive - I have one server running both
Windows Server 2003 and SQL Server 2000 as a dev box.

I will try the login idea you suggested - *if* it does then work as it
should - what am I going to need to do to make it work? As I mentioned the
only part failing was the SQL update - which confused me considering I was
specifying the user/pwd to use for that in the code..

Any further info would be appreciated,

Regards

Rob


> As I mentioned the only part failing was the SQL update - which confused
me considering

I was specifying the user/pwd to use for that in the code
Rob, I saw this, and is why I thought you may be barking up the wrong tree.
Why are you so sure it is the SQL failing? What is your connection string?

"Rob Meade" <ro**********@NOSPAMubht.swest.nhs.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... "Chris Botha" wrote ...

Rob, it may be a security problem, especially if the directory is a network

drive. I''m not sure, but attaching the debugger may run the service as the interactive user. A quick test should be to run the service as your own
login, rather than the local system account, and see if it works then.



Hi Chris,

I can confirm that it isnt a network drive - I have one server running


both Windows Server 2003 and SQL Server 2000 as a dev box.

I will try the login idea you suggested - *if* it does then work as it
should - what am I going to need to do to make it work? As I mentioned the
only part failing was the SQL update - which confused me considering I was
specifying the user/pwd to use for that in the code..

Any further info would be appreciated,

Regards

Rob



这篇关于好奇的问题..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆