Click to See Complete Forum and Search --> : NT Service & Database


BMW
June 19th, 2002, 05:59 AM
Hello,

I've written a NT service accessing to an ORACLE database via OLE DB. This service is to be installed on a WIN2K server, where the ORACLE database is yet installed too. I'm developping in VC++ 6.0, on a WIN2K workstation, connected to this server.

The problem is that my service is unable to access to the database : the first SQL request it sends make it crash.

I get a 1069 error from the Control Panel/Service when trying to make my service start (because this is when it sends the SQL request), after having the service installed.

When the applicatioin is not running as a server (but as a console application), it works perfectly and has no problems to connect to the database and get the data from it. That's why I understand this is a security problem.


Can somebody tell me what access rights am I supposed to give to my service to make it able to access to the database ?

Kdr Kane
June 19th, 2002, 11:12 AM
Run "services.msc" from the Run command.

Double-click on your service to bring up the properties.

Select the Logon tab.

Select the radio button "This account:". Enter an ID that has access to the SQL database with the password.

When you are running the program from the command prompt, it's using your account context for authentication to the database. So, this allows the service to use the same credentials instead of the System account.