DB Monitor and Windows Service

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
baumsh
Posts: 7
Joined: Fri 08 Sep 2006 14:54

DB Monitor and Windows Service

Post by baumsh » Mon 11 Aug 2008 16:18

Hi,

I'd like to ask on how I could make the DBMonitor work when the application is running under a windows service, it seems that the login cridentials need to be the same as the service, however we have no control on the service part and we could not specify it to login as a specific user, however I'm wondering if we could do it the other way around and specify the login cridentials of the DBMonitor, which we do have access to and we could spcify the login details or launch it the way we want.

Also from previous posts it seems that I should be able to deploy the exe and dll to a clients machine and the setup is not needed in order to have the DBMonitor running, however if we just copy these 2 files we get an error that there is a version mismatch, however if we then run the install that actually installs the same files that caused us the problems if we copied it, it then works. We'd really like to avoid an install process here.

Regards,
Shloma Baum
Pioneer Interactive, Inc.
http://www.PioneerInteractive.com

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: DB Monitor and Windows Service

Post by Dimon » Thu 14 Aug 2008 12:34

baumsh wrote:I'd like to ask on how I could make the DBMonitor work when the application is running under a windows service, it seems that the login cridentials need to be the same as the service, however we have no control on the service part and we could not specify it to login as a specific user, however I'm wondering if we could do it the other way around and specify the login cridentials of the DBMonitor, which we do have access to and we could spcify the login details or launch it the way we want.
You should not connect to DBMonitor. DBMonitor monitors all SQL clients running on the machine, where DBMonitor is executed.
baumsh wrote:Also from previous posts it seems that I should be able to deploy the exe and dll to a clients machine and the setup is not needed in order to have the DBMonitor running, however if we just copy these 2 files we get an error that there is a version mismatch, however if we then run the install that actually installs the same files that caused us the problems if we copied it, it then works. We'd really like to avoid an install process here.
DBMonitor uses COM object, which must be registered in system.
Therefore, to use DBMonitor you should register it on every machine, where you want to use it. You can do it with the following command:
regsvr32 DBMonitor.dll

baumsh
Posts: 7
Joined: Fri 08 Sep 2006 14:54

Post by baumsh » Fri 15 Aug 2008 17:36

Hi,

Thanks a lot for your response!

I'm not sure I explained the situation enough. Bascially if the application to be monitored is a Windows Service then the DBMonitor does not intercept its calls, only if the app is running as a stand alone it shows. The situation is similar to this topic: http://www.devart.com/forums/viewtopic. ... =dbmonitor but in my case I have no control over the service to specify which account it should run under, so my question is basically if there is a way I could specify under which account the DBMonitor should run so it DOES have rights to the Windows Service.

Hope it makes sense now.

Regards,
Shloma

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 18 Aug 2008 12:13

There's no possibility in DBMonitor to specify user account that will be runned under.
You can run service under another user account specifying needed user name in service properties.
Or you can write own appliction to run DBMonitor under needed account, using the CreateProcessWithLogonW function of WinAPI. You can find more detailed information about it in MSDN.

baumsh
Posts: 7
Joined: Fri 08 Sep 2006 14:54

Post by baumsh » Mon 22 Sep 2008 13:32

Hi,

Is there no way to make that the DBMonitor should work even if its not running under the same account as the application that is being monitored?

I'm having a big problem here, as our application that is being monitored is installed as a Windows Service running under the LocalSystem account, and we have no control over that and cant be changed, now we've finally managed to get the DBMonitor to run under the LocalSystem account, but this account dosn't allow you to run the app interactively and although the dbmonitor is running, as I could see in the task manager it is not interactive and we can't see anything that is being monitored.

So back to my question if there is any way to make the DBMonitor work even though its not running as the same account as the application being monitored? otherwise its pretty much unusable for windows services or IIS applications, and I'd love to use it for our app.

Best Regards,
Shloma

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 24 Sep 2008 09:38

DBMonitor should work even if it is running under different account than does the monitored application. Try to check off the "Fast User Switching" mode in your Windows system.

Post Reply