Windows服务和VFPOLEDB [英] Windows service and VFPOLEDB

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

问题描述

你好


我写了一个小型的C#程序,使用VFPOLEDB它正在工作

完美。然后,我重新设计它作为服务工作(如
http://msdn.microsoft.com/library/de...plication.asp)


不幸的是,现在我的服务无法使用VFPOLEDB,声明它没有注册

"在我的本地机器上。


服务安装在LocalService帐户上。


我怀疑这有安全政策,但我不知道知道

从哪里开始:(


-

Semper Fidelis


Adam Klobukowski
at***@gabo.pl

解决方案

Adam,


这个错误表明它不会是没有注册的b / b
,但如果它适用于正常应用,那么错误

本身就不正确。


有一种简单的方法来测试它。基本上,让服务运行

在您运行应用程序的同一个用户帐户下,然后您将它作为服务运行。如果它有效,那么您知道这是一个权利问题,否则,

这是VFPOLEDB驱动程序的一个问题。


希望这会有所帮助。

-

- Nichola s Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" Adam Klobukowski" <在*** @ gabo.pl>在留言中写道

news:cr ********** @ nemesis.news.tpi.pl ...

Hello
http://msdn.microsoft.com/library/de...plication.asp)

不幸的是,现在我的服务无法使用VFPOLEDB,声明它没有注册在我的本地机器上。

服务安装在LocalService帐户上。

我怀疑这有安全政策,但我不知道
在哪里开始:(

-
Semper Fidelis

Adam Klobukowski
at***@gabo.pl



Nicholas Paldino [.NET / C#MVP] napisa3(a):

Adam,

这个错误表明它不会被注册,但如果它适用于正常的应用程序,那么可能错误
是本身是不正确的。

有一种简单的方法来测试它。基本上,在你运行应用程序之前,使服务运行
在你运行应用程序之前
它一个服务。如果它有效,那么你知道这是一个权利问题,否则,这是VFPOLEDB驱动程序的一个问题。

希望这有帮助。



我试过我t usnig LocalSystem帐户,我也有同样的错误。当我试图以本地用户身份提供服务时,我总是有未知的

帐户/错误的密码错误,但它们还可以。


-

Semper Fidelis


Adam Klobukowski
at***@gabo.pl


检查注册表中是否有HKEY_CLASSES_ROOT \VFPOLEDB.1。

如果这个键不可用,这意味着它作为用户

组件而不是作为系统组件安装,这也意味着它应该被使用

from a用户上下文不是来自服务上下文。

但是,如果你想从服务中试用它,你可以运行regsvr32

vfpoledb.dll。并希望将密钥添加到HKCR,如果没有,您将不得不从HKCU手动复制


另请注意,COM类可能必须在STA中实例化,

服务的线程在MTA中运行,所以你必须产生另外一个线程并将其初始化为MTA的公寓状态并访问你的

此线程中的VFP组件。


Willy。


" Adam Klobukowski" <在*** @ gabo.pl>在消息中写道

news:cr ********* @ nemesis.news.tpi.pl ...

Nicholas Paldino [.NET / C#MVP ] napisa3(a):

Adam,

这个错误表明它不会被注册,但如果它适用于正常情况应用程序,然后可能错误本身就是错误的。

有一种简单的方法来测试它。基本上,使服务运行
在您运行应用程序的同一个用户帐户之前,然后再将其作为服务。如果它有效,那么你知道它是一个权利问题,否则,这是VFPOLEDB驱动程序的一个问题。

希望这会有所帮助。



我试过usnig LocalSystem帐户,我也有同样的错误。当我试图以本地用户的身份提供服务时,我总是有未知的帐号/错误的
密码错误,但它们还可以。

-
Semper Fidelis

Adam Klobukowski
at***@gabo.pl



Hello

I''ve written a small C# program that uses VFPOLEDB it is working
perfectly. Then, I redesigned it to work as service (as described in
http://msdn.microsoft.com/library/de...plication.asp).

Unfortunetly, now my service is unable to use VFPOLEDB, stating that it
"is not registered" on my local machine.

Service is installed on LocalService account.

I suspect this has something with security policies, but I don''t know
where to start :(

--
Semper Fidelis

Adam Klobukowski
at***@gabo.pl

解决方案

Adam,

That error indicates that it would be something else than it not being
registered, but if it works for a normal application, then perhaps the error
is incorrect in itself.

There is an easy way to test this. Basically, make the service run
under the same user account which you ran the application on before you made
it a service. If it works, then you know it is a rights issue, otherwise,
it is an issue with the VFPOLEDB driver.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Adam Klobukowski" <at***@gabo.pl> wrote in message
news:cr**********@nemesis.news.tpi.pl...

Hello

I''ve written a small C# program that uses VFPOLEDB it is working
perfectly. Then, I redesigned it to work as service (as described in
http://msdn.microsoft.com/library/de...plication.asp).

Unfortunetly, now my service is unable to use VFPOLEDB, stating that it
"is not registered" on my local machine.

Service is installed on LocalService account.

I suspect this has something with security policies, but I don''t know
where to start :(

--
Semper Fidelis

Adam Klobukowski
at***@gabo.pl



Nicholas Paldino [.NET/C# MVP] napisa3(a):

Adam,

That error indicates that it would be something else than it not being
registered, but if it works for a normal application, then perhaps the error
is incorrect in itself.

There is an easy way to test this. Basically, make the service run
under the same user account which you ran the application on before you made
it a service. If it works, then you know it is a rights issue, otherwise,
it is an issue with the VFPOLEDB driver.

Hope this helps.


I tried it usnig LocalSystem account, and I have the same error. When I
tried to intall service as local user, I always had unknown
account/wrong pasword error, but they were ok.

--
Semper Fidelis

Adam Klobukowski
at***@gabo.pl


Check if you have HKEY_CLASSES_ROOT\VFPOLEDB.1 in the registry.
If this key is not available, it means that it''s installed as a User
component not as a System component, and that also means it should be used
from a Users context NOT from a service context.
However, if you want to try it from a service, you can run "regsvr32
vfpoledb.dll" and hope the keys are added to HKCR, if not you will have to
copy them manually from HKCU.
Note also that probably the COM classes have to instantiated in a STA,
Services have their threads running in an MTA, so you will have to spawn
another thread and initialize it''s apartment state for MTA and access your
VFP components from this thread.

Willy.

"Adam Klobukowski" <at***@gabo.pl> wrote in message
news:cr*********@nemesis.news.tpi.pl...

Nicholas Paldino [.NET/C# MVP] napisa3(a):

Adam,

That error indicates that it would be something else than it not
being registered, but if it works for a normal application, then perhaps
the error is incorrect in itself.

There is an easy way to test this. Basically, make the service run
under the same user account which you ran the application on before you
made it a service. If it works, then you know it is a rights issue,
otherwise, it is an issue with the VFPOLEDB driver.

Hope this helps.


I tried it usnig LocalSystem account, and I have the same error. When I
tried to intall service as local user, I always had unknown account/wrong
pasword error, but they were ok.

--
Semper Fidelis

Adam Klobukowski
at***@gabo.pl



这篇关于Windows服务和VFPOLEDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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